[cfe-dev] Determining whether Container<T>()==Container<T>() can compile?
steveire at gmail.com
Tue May 28 02:48:26 PDT 2013
Mailing List Email wrote:
> It can be done yourself, or am I misunderstanding your question?
> if (IsEqComparable<std::vector<int>, std::vector<int>>::value)
> std::cout << "Yes!\n";
> std::cout << "No!\n";
Thanks for the suggestion.
Your solution does not work for nested containers, however:
if (IsEqComparable<std::vector<bar>, std::vector<bar> >::value)
std::cout << "Yes!\n";
std::cout << "No!\n";
Does that make the problem more clear? Any further suggestions?
> On 24 May 2013 10:41, Stephen Kelly
> <steveire at gmail.com> wrote:
>> 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
>> to libcxx to make it possible to write such a template for its stl
>> Does anyone else have any other ideas for something that would work with
>> todays stl implementations?
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
More information about the cfe-dev