[Development] C++11 decltype magic with a container?

Thiago Macieira thiago.macieira at intel.com
Wed May 22 16:41:12 CEST 2013


On quarta-feira, 22 de maio de 2013 11.07.44, Stephen Kelly wrote:
> QSpiRelationArray::value_type is QSpiRelationArrayEntry which, being a
> QPair,  does have a operator==(), so the decltype gives the result that the
> std::find should work.

In other words, QPair has an operator==, but it can't be used because it won't 
compile. Your code detects that it exists, but can't be sure that it works?

Then the problem is in QPair.

You need to modify all operator== in classes with templates to make sure they 
are enable_if for the case where its template(s) is(are) comparable.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130522/bebf88ed/attachment.sig>


More information about the Development mailing list