Details
-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.1.0 RC1
-
None
-
all environment
Description
The story:
On a French forum, someone asked how to implement the <operator for QPoint.
My response was to prefer a functor, because there are (at least) two ways to compare the point by the the X-axis value and then the Y-axis value and the Y-axis value and then X-axis value
The idea of the PO (good or bad?) was to use the QPoint like a key in a QMap.
But if it is possible to use a user defined comparison with std :: map, QMap does not provide such a possibility.
Memory: the full definition of std :: map is
template <typename Key, value, typename = typename Comp std::less>
class map
;}
Since QMap provides a constructor QMap (std :: map <Key, Value> const &), would not it be nice to add a third template parameter for comparison to STL QMap more consistent and increase its capacity?
I have not checked the implementation of QMap, but I think most of the changes are expected to occur in the comparison function (which would then use the comparator and not the "<" operator?).
Attachments
Issue Links
- relates to
-
QTBUG-68948 Make QMap (and other containers?) more SL compliant
-
- Open
-