[RFC] Interpretation of DR 198 resolution

Paolo Carlini pcarlini@unitus.it
Tue Nov 11 18:29:00 GMT 2003


Thanks Nathan for your feedback.

Unfortunately, I'm not sure to fully understand your explanation,
or, better, I'm not sure to understand why the resolution wants to
change "Effects:" from:

   Iterator tmp = current;
   return *--tmp;

to

   this->tmp = current;
   --this->tmp;
   return *this->tmp;

and, moreover, add:

[Note: This operation must use an auxiliary member variable, rather
than a temporary variable, to avoid returning a reference that persists
beyond the lifetime of its associated iterator.
(See 24.1 [lib.iterator.requirements].) The name of this member variable
is shown for exposition only. --end note]

why, in other termns, if the current reverse iterator follows strictly
the former in the implementation, shouldn't now follow the latter?

I see, the additional member variable we don't like it ;) ...

Thanks again,
Paolo.



More information about the Libstdc++ mailing list