<div dir="ltr">That is unfortunate. I am afraid that, at this moment, I do not know of a better solution. It would seem that decltype erroneously makes the overloaded well-formed while the idea was that it should not.<br>Perhaps someone else will have another suggestion.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 28 May 2013 11:48, Stephen Kelly <span dir="ltr"><<a href="mailto:steveire@gmail.com" target="_blank">steveire@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Mailing List Email wrote:<br>
<br>
> It can be done yourself, or am I misunderstanding your question?<br>
> Example:<br>
<br>
</div><div class="im">>     if (IsEqComparable<std::vector<int>, std::vector<int>>::value)<br>
>         std::cout << "Yes!\n";<br>
>     else<br>
>         std::cout << "No!\n";<br>
<br>
<br>
</div>Thanks for the suggestion.<br>
<br>
Your solution does not work for nested containers, however:<br>
<br>
<br>
    if (IsEqComparable<std::vector<bar>, std::vector<bar> >::value)<br>
<div class="im">        std::cout << "Yes!\n";<br>
    else<br>
        std::cout << "No!\n";<br>
<br>
</div>outputs "Yes!".<br>
<br>
Does that make the problem more clear? Any further suggestions?<br>
<br>
Thanks,<br>
<br>
Steve<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> On 24 May 2013 10:41, Stephen Kelly<br>
> <<a href="mailto:steveire@gmail.com">steveire@gmail.com</a>> wrote:<br>
><br>
>><br>
>> Hi there,<br>
>><br>
>> Code such as<br>
>><br>
>>   std::vector<A> veca, vecb;<br>
>>   veca == vecb;<br>
>><br>
>> can only compile if A()==A() can compile, if you'll forgive me taking<br>
>> some descriptive shortcuts.<br>
>><br>
>> I tried writing a template to determine if a type can be<br>
>> equality-compared for the purpose of type-erasure:<br>
>><br>
>>  <a href="http://thread.gmane.org/gmane.comp.lib.qt.devel/11120" target="_blank">http://thread.gmane.org/gmane.comp.lib.qt.devel/11120</a><br>
>><br>
>> Adding auto and trailing return type seems to be helpful:<br>
>><br>
>>  <a href="http://thread.gmane.org/gmane.comp.lib.qt.devel/11120/focus=11157" target="_blank">http://thread.gmane.org/gmane.comp.lib.qt.devel/11120/focus=11157</a><br>
>><br>
>> Would the suggestion from Olivier Goffart be something that could be<br>
>> applied<br>
>> to libcxx to make it possible to write such a template for its stl<br>
>> container<br>
>> implementations?<br>
>><br>
>> Does anyone else have any other ideas for something that would work with<br>
>> todays stl implementations?<br>
>><br>
>> Thanks,<br>
>><br>
>> Steve.<br>
>><br>
>><br>
>> _______________________________________________<br>
>> cfe-dev mailing list<br>
>> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
>><br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>