A
Azumanga
Hello.
A small question with regards input iterators.
Table 72 of the standard says with regards ++r on an input iterator r:
"any copies of the previous value of r are no longer required to be
dereferencable or in the domain of =="
Consider therefore the following code segment, where r is a currently
valid dereferencable input iterator.
a=r;
++r;
if(a==a) {} // Line 1
if(a==r) {} // Line 2
++a; // Line 3
a=r; // Line 4
I assume therefore lines 1,2 and 3 are undefined and anything could
happen (including a crash).
Line 4 is defined (although to be honest fairly pointless)
Is this a correct reading?
Thank you
Azumanga
A small question with regards input iterators.
Table 72 of the standard says with regards ++r on an input iterator r:
"any copies of the previous value of r are no longer required to be
dereferencable or in the domain of =="
Consider therefore the following code segment, where r is a currently
valid dereferencable input iterator.
a=r;
++r;
if(a==a) {} // Line 1
if(a==r) {} // Line 2
++a; // Line 3
a=r; // Line 4
I assume therefore lines 1,2 and 3 are undefined and anything could
happen (including a crash).
Line 4 is defined (although to be honest fairly pointless)
Is this a correct reading?
Thank you
Azumanga