This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.
Section: 99 [move.iter.op.index] Status: C++11 Submitter: Doug Gregor Opened: 2008-08-21 Last modified: 2016-02-10
Priority: Not Prioritized
View all issues with C++11 status.
move_iterator's operator is declared as:
reference operator(difference_type n) const;
This has the same problem that reverse_iterator's operator used to have: if the underlying iterator's operator returns a proxy, the implicit conversion to value_type&& could end up referencing a temporary that has already been destroyed. This is essentially the same issue that we dealt with for reverse_iterator in DR 386.
[ 2009-07-28 Reopened by Alisdair. No longer solved by concepts. ]
[ 2009-08-15 Howard adds: ]
I recommend closing this as a duplicate of 1051 which addresses this issue for both move_iterator and reverse_iterator.
[ 2009-10 Santa Cruz: ]
Move to Ready. Note that if 1051 is reopened, it may yield a better resolution, but 1051 is currently marked NAD.
In 126.96.36.199 [move.iterator] and 99 [move.iter.op.index], change the declaration of move_iterator's operator to:
referenceoperator(difference_type n) const;
[ San Francisco: ]
NAD Editorial, see N2777.