Details
-
Bug
-
Resolution: Cannot Reproduce
-
P3: Somewhat important
-
None
-
6.7.2
-
None
Description
In containers like QMap, comparing iterator with const_iterator does not always return the expected output.
A quick search through the bug reports shows that this issue has been dismissed in the past as "it's wrong to mix iterator and const_iterator": QTBUG-50314 QTBUG-10025 QTBUG-69182
However it is in the C++ standard, since C++14, that you can compare iterator and const_iterator.
[container.requirements.general] paragraph 7:
In the expressions i == j i != j i < j i <= j i >= j i > j i <=> j i - j where i and j denote objects of a container’s iterator type, either or both may be replaced by an object of the container’s const_iterator type referring to the same element with no change in semantics