A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue979 below:

Issue 979: Bad example

This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD Editorial status.

979. Bad example

Section: 24.5.4 [move.iterators] Status: NAD Editorial Submitter: Howard Hinnant Opened: 2009-02-03 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [move.iterators].

View all issues with NAD Editorial status.

Discussion:

24.5.4 [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.

[ Batavia (2009-05): ]

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

Proposed resolution:

Change 24.5.4 [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]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4