[ub] Justification for < not being a total order on pointers?
Christopher Jefferson
chris at bubblescope.net
Wed Oct 16 23:43:19 CEST 2013
On 16 October 2013 22:25, Nevin Liber <nevin at eviloverlord.com> wrote:
> On 16 October 2013 16:15, Christopher Jefferson <chris at bubblescope.net>
> wrote:
>>
>> On 16 October 2013 00:14, Gabriel Dos Reis <gdr at microsoft.com> wrote:
>> > Nevin --
>> > Are you asking that operator< be a total order on
>> > std::deque<T>::iterator?
>> >
>>
>> On a practical note, I believe this would arise naturally, if
>> operator< was a total order on pointers.
>
>
> No, it does not. It would be a pessimization. As pointed out on the LWG
> reflector:
You (and Stephan) are right, it would be for Visual Studio (and that
is reasonable). gcc (which is what I looked at) stores a raw pointer
to the current value, and compares first the parent pointer, and then
that raw pointer. Here a complete ordering on raw pointers would
naturally give a complete ordering on deque iterators.
Chris
More information about the ub
mailing list