Title
std::reverse_iterator should be a literal type
Status
resolved
Section
[reverse.iterators]
Submitter
Jeffrey Yasskin

Created on 2012-10-30.00:00:00 last changed 104 months ago

Messages

Date: 2016-05-05.14:53:40
This issue was Resolved by paper

Proposed resolution:

P0031R0 adopted at Jacksonville, 2016.
Date: 2012-10-30.00:00:00

std::reverse_iterator::reverse_iterator(Iterator) should be constexpr so that other constexpr functions can return reverse_iterators. Of the other methods, the other constructors, base(), operator+, operator-, operator[], and the non-member operators can probably also be constexpr.

operator* cannot be constexpr because it involves an assignment to a member variable. Discussion starting with c++std-lib-33282 indicated that it would be useful to make reverse_iterator a literal type despite this restriction on its use at compile time.

History
Date User Action Args
2016-05-05 14:53:40adminsetmessages: + msg8070
2016-05-05 14:53:40adminsetstatus: new -> resolved
2012-10-30 00:00:00admincreate