[cfe-dev] Determining whether Container<T>()==Container<T>() can compile?

Stephen Kelly steveire at gmail.com
Fri May 24 01:41:09 PDT 2013

Hi there,

Code such as 

  std::vector<A> veca, vecb;
  veca == vecb;

can only compile if A()==A() can compile, if you'll forgive me taking some 
descriptive shortcuts.

I tried writing a template to determine if a type can be equality-compared 
for the purpose of type-erasure:


Adding auto and trailing return type seems to be helpful:


Would the suggestion from Olivier Goffart be something that could be applied 
to libcxx to make it possible to write such a template for its stl container 

Does anyone else have any other ideas for something that would work with 
todays stl implementations?



More information about the cfe-dev mailing list