Created on 2017-02-03.00:00:00 last changed 78 months ago
Proposed resolution:
This wording is relative to N4659.
Add a new paragraph at the end of [iterator.requirements.general] as indicated:
-12- An invalid iterator is an iterator that may be singular.(footnote: […])
Iterators are called constexpr iterators if all defined iterator category operations, except a pseudo-destructor call ([expr.pseudo]) or the construction of an iterator with a singular value, are usable as constant expressions. [Note: For example, the types "pointer to int" and reverse_iterator<int*> are constexpr random access iterators. — end note] -13- In the following sections, a and b denote […]
Add a new paragraph at the end of [array.overview]:
-3- An array satisfies all of the requirements of a container […]
-?- iterator and const_iterator satisfy the constexpr iterator requirements ([iterator.requirements.general]).
[ 2018-06 Rapperswil Wednesday issues processing ]
This was resolved by P0858, which was adopted in Jacksonville.
[ 2017-11 Albuquerque Saturday issues processing ]
P0858R0 (adopted on Sat; to be moved in Jacksonville) will resolve this.
[ 2017-11 Albuquerque Thursday ]
It looks like 1581 is going to be resolved this week, so we should revisit soon.
[ 2017-11 Albuquerque Wednesday issue processing ]
Status to Open; We don't want to do this yet; gated on Core issue 1581 (affects swap). See also 2800.
Thomas to talk to Anthony about writing a paper detailing what it takes to be a constexpr iterator.
[ 2017-04-22, Antony Polukhin provides improved wording ]
[ 2017-03-04, Kona ]
Set priority to 2. Lisa and Alisdair to work with Antony to come up with better wording. The same wording can be used for 2938.
Previous resolution [SUPERSEDED]:
This wording is relative to N4640.
Add a new paragraph at the end of [array.overview]:
-3- An array satisfies all of the requirements of a container […]
-?- All operations on iterator and const_iterator that are required to satisfy the random access iterator requirements are usable in constant expressions.
[ 2017-03-02, Tim Song comments ]
I don't believe the blanket "all operations" wording is quite correct.
First, T t; (required by DefaultConstructible) isn't usable in a constant expression if the iterator is a pointer, since it would leave it uninitialized. Second, an explicit destructor call u.~T() (required by Destructible) isn't usable if the iterator is a class type because it explicitly invokes a non-constexpr function (the destructor); see [expr.const]/2.2.[ 2017-03-02, Kona ]
Wording tweaks suggested by LWG applied.
[ 2017-03-01, Kona ]
Antony Polukhin provides revised wording.
[ 2017-02-20 Marshall adds wording ]
I used the formulation "are literal types", rather than "shall be", since that denotes a requirement on the user.
Previous resolution [SUPERSEDED]:
This wording is relative to N4640.
Add a new paragraph at the end of [array.overview]:
-?- iterator and const_iterator are literal types.
Force the literal type requirement for the iterator and const_iterator in the std::array so that iterators of std::array could be used in constexpr functions.
Proposed change: Add to the end of the [array.overview] section: iterator and const_iterator shall be literal types.
History | |||
---|---|---|---|
Date | User | Action | Args |
2018-06-12 02:06:47 | admin | set | messages: + msg9902 |
2018-06-12 02:06:47 | admin | set | status: open -> resolved |
2017-11-13 19:00:40 | admin | set | messages: + msg9553 |
2017-11-10 03:05:33 | admin | set | messages: + msg9537 |
2017-11-10 03:05:33 | admin | set | messages: + msg9536 |
2017-11-10 03:05:33 | admin | set | status: new -> open |
2017-04-24 11:58:06 | admin | set | messages: + msg9165 |
2017-03-14 03:14:09 | admin | set | messages: + msg9112 |
2017-03-02 18:49:03 | admin | set | messages: + msg9040 |
2017-03-02 17:41:20 | admin | set | messages: + msg9038 |
2017-03-01 17:21:08 | admin | set | messages: + msg9021 |
2017-02-20 18:11:16 | admin | set | messages: + msg8956 |
2017-02-20 18:11:16 | admin | set | messages: + msg8955 |
2017-02-03 00:00:00 | admin | create |