Title
Bad example
Status
nad editorial
Section
[move.iterators]
Submitter
Howard Hinnant

Created on 2009-02-03.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [move.iterators]/2:

-2- [Example:

setlist<string> s; 
// populate the setlist s 
vector<string> v1(s.begin(), s.end());          // copies strings into v1 
vector<string> v2(make_move_iterator(s.begin()), 
                  make_move_iterator(s.end())); // moves strings into v2

-- end example]

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

We agree with the proposed resolution. Move to NAD Editorial.

Date: 2009-02-03.00:00:00

[move.iterators] has an incorrect example:

-2- [Example:

set<string> s; 
// populate the set s 
vector<string> v1(s.begin(), s.end());          // copies strings into v1 
vector<string> v2(make_move_iterator(s.begin()), 
                  make_move_iterator(s.end())); // moves strings into v2

-- end example]

One can not move from a set because the iterators return const references.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg4666
2010-10-21 18:28:33adminsetmessages: + msg4665
2009-02-03 00:00:00admincreate