Issue 2061: make_move_iterator and arrays (original) (raw)
This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++14 status.
2061. make_move_iterator
and arrays
Section: 24.2 [iterator.synopsis], 24.5.4 [move.iterators] Status: C++14 Submitter: Marc Glisse Opened: 2011-05-28 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [iterator.synopsis].
View all issues with C++14 status.
Discussion:
The standard library always passes template iterators by value and never by reference, which has the nice effect that an array decays to a pointer. There is one exception: make_move_iterator
.
#include int main(){ int a[]={1,2,3,4}; std::make_move_iterator(a+4); std::make_move_iterator(a); // fails here }
[ 2011 Bloomington. ]
Move to Ready.
Proposed resolution:
This wording is relative to the FDIS.
- Modify the header
<iterator>
synopsis in 24.2 [iterator.synopsis]:namespace std {
[…]
template
move_iterator make_move_iterator(const Iterator&Iterator i);[…]
} - Modify the class template
move_iterator
synopsis in 24.5.4.2 [move.iterator]:namespace std {
[…]
template
move_iterator make_move_iterator(const Iterator&Iterator i);
} - Modify 24.5.4.9 [move.iter.nonmember]:
template
move_iterator make_move_iterator(const Iterator&Iterator i);-3- Returns:
move_iterator<Iterator>(i)
.