Title
[uninitialized_]copy_n() defect
Status
nad
Section
[alg.copy] [uninitialized.copy]
Submitter
Sean Parent

Created on 2013-02-14.00:00:00 last changed 90 months ago

Messages

Date: 2017-06-02.00:00:00

[ 2017-06-02 Issues Telecon ]

This change has been made in the Ranges TS.

Resolve as NAD

Date: 2017-06-05.15:41:21

[ 2017-02 in Kona, LEWG recommends NAD ]

Potentially breaks lots of things. Cannot overload on return type. Pair, tuple, or struct return? New name? Needs paper with a new algorithm (copy_n_works)? Not an issue for istream iterators (can get stream and get a new iterator). Don’t use this function, use ranges.

Date: 2016-08-03.12:32:27

[ 2016-08 Chicago ]

Tues PM: refer to LEWG

Date: 2013-02-14.00:00:00

copy_n() and uninitialized_copy_n() only return the output iterator, and not the input iterator. Likely the interface was simply copied from the original STL. Unfortunately the interface in the original STL contains a bug.

copy_n() and uninitialized_copy_n() must return the resulting input iterator as well as the output iterator (I would suggest returning a pair). Without this, there is no way to continue reading from an actual input iterator — and if it is really a forward iterator, it will cost n increments to get back to where you were.

History
Date User Action Args
2017-06-05 15:41:21adminsetmessages: + msg9220
2017-06-05 15:41:21adminsetmessages: + msg9219
2017-06-05 15:41:21adminsetstatus: lewg -> nad
2016-08-03 12:32:27adminsetmessages: + msg8353
2016-08-03 12:32:27adminsetstatus: new -> lewg
2013-02-14 00:00:00admincreate