Title
Iota's requirements on T are too strong
Status
c++11
Section
[numeric.iota]
Submitter
Daniel Krügler

Created on 2008-08-20.00:00:00 last changed 162 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change the first sentence of [numeric.iota]/1:

Requires: T shall meet the requirements of CopyConstructible and Assignable types, and shall be assignable to ForwardIterator's value type. [..]

Date: 2010-10-21.18:28:33

[ 2009-10 Santa Cruz: ]

Change 'convertible' to 'assignable', Move To Ready.

Date: 2009-07-30.00:00:00

[ 2009-07-30 Daniel reopened: ]

with the absence of concepts, this issue (closed) is valid again and I suggest to reopen it. I also revised by proposed resolution based on N2723 wording:

Date: 2010-10-21.18:28:33

[ post San Francisco: ]

Issue pulled by author prior to review.

Date: 2008-08-20.00:00:00

According to the recent WP N2691, [numeric.iota]/1, the requires clause of std::iota says:

T shall meet the requirements of CopyConstructible and Assignable types, and shall be convertible to ForwardIterator's value type.[..]

Neither CopyConstructible nor Assignable is needed, instead MoveConstructible seems to be the correct choice. I guess the current wording resulted as an artifact from comparing it with similar numerical algorithms like accumulate.

Note: If this function will be conceptualized, the here proposed MoveConstructible requirement can be removed, because this is an implied requirement of function arguments, see N2710/[temp.req.impl]/3, last bullet.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg4133
2010-10-21 18:28:33adminsetmessages: + msg4132
2010-10-21 18:28:33adminsetmessages: + msg4131
2010-10-21 18:28:33adminsetmessages: + msg4130
2008-08-20 00:00:00admincreate