Title
make_move_iterator and arrays
Status
c++14
Section
[iterator.synopsis] [move.iterators]
Submitter
Marc Glisse

Created on 2011-05-28.00:00:00 last changed 123 months ago

Messages

Date: 2011-08-16.23:35:18

Proposed resolution:

This wording is relative to the FDIS.

  1. Modify the header <iterator> synopsis in [iterator.synopsis]:

    namespace std {
      […]
      template <class Iterator>
      move_iterator<Iterator> make_move_iterator(const Iterator&Iterator i);
    
      […]
    }
    
  2. Modify the class template move_iterator synopsis in [move.iterator]:

    namespace std {
      […]
      template <class Iterator>
      move_iterator<Iterator> make_move_iterator(const Iterator&Iterator i);
    }
    
  3. Modify [move.iter.nonmember]:

    template <class Iterator>
    move_iterator<Iterator> make_move_iterator(const Iterator&Iterator i);
    

    -3- Returns: move_iterator<Iterator>(i).

Date: 2011-08-16.23:35:18

[ 2011 Bloomington. ]

Move to Ready.

Date: 2011-05-28.00:00:00

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 <iterator>
int main(){
  int a[]={1,2,3,4};
  std::make_move_iterator(a+4);
  std::make_move_iterator(a); // fails here
}
History
Date User Action Args
2014-02-20 13:20:35adminsetstatus: wp -> c++14
2012-02-12 18:36:43adminsetstatus: voting -> wp
2012-02-09 04:07:48adminsetstatus: ready -> voting
2011-08-16 23:35:18adminsetmessages: + msg5856
2011-08-16 23:35:18adminsetstatus: new -> ready
2011-05-28 20:35:30adminsetmessages: + msg5796
2011-05-28 00:00:00admincreate