Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.8.2, 5.0.0
-
None
Description
Both QSharedDataPointer and QExplicitlySharedDataPointer don't provide operator<, which makes it harder to use them as replacements to ordinary pointers for example when used as keys in QMap. Worse, they do provide operator bool, so code that uses Q[Explicitly]SharedDataPointer as a key in QMap compiles (at least in gcc 4.5.3), but behaves unexpectedly, because the pointers coerce to bool and are then compared as equal in most cases.
I haven't checked it, but QHash<Q[Explicitly]SharedDataPointer, T> may suffer from similar problem as qHash( Q[Explicitly]SharedDataPointer<U> ) doesn't seem to be provided.
It would be nice if the operators could be added for Qt 5 so that users don't need to create work-arounds.