https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70303

Casey Carter <Casey at Carter dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Casey at Carter dot net

--- Comment #4 from Casey Carter <Casey at Carter dot net> ---
(In reply to Jonathan Wakely from comment #3)
> Or is the implication of equality being valid that a+n is valid for n==0,
> and therefore b-a is valid, and therefore relational ops are valid?

Certainly b-a is required to be valid, since such an n exists as required by
[random.access.iterators] - but admittedly the IS doesn't specify the domain
for relational comparisons on Cpp17 iterators. IMO this is a defect since it
implies you can *never* compare two iterators with e.g. <. 

We should require the domain of relational comparisons to be the same as the
domain of equality, which would then make it clear that value-initialized
iterators are in their domain. (I was under the impression that we *did*
require this "somewhere" when I filed this issue and fixed MSFTL's iterators.)

Reply via email to