On quarta-feira, 22 de maio de 2013 17.04.21, Stephen Kelly wrote: > > 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? > > Correct. The compiler sees that operator==() exists, but it doesn't look > into the implementation to see that it contains t1 == other.t1, and > therefore it doesn't check if T1::operator==() exists.
The operator exists and there's nothing preventing it from existing. The problem is that the operator exists but can't be used. > > Then the problem is in QPair. > > It's a general problem/limitation in the decltype trick really which affects > any container. You need to add enable_if to all those containers to make sure they export their requirement to the outside. This is not a QVariant problem, it's a container problem. > > 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. > > See my initial email. Now that we've stepped back it might make more sense > to you. It does. You need to make sure that there's an enable_if in the function you're trying to detect. You can't detect if the function compiles. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development