v
should be claimedSection: 23.2.2.5 [container.alloc.reqmts] Status: WP Submitter: jim x Opened: 2023-07-10 Last modified: 2023-11-22
Priority: Not Prioritized
View all other issues in [container.alloc.reqmts].
View all issues with WP status.
Discussion:
23.2.2.5 [container.alloc.reqmts] p2 says:
[…] an expression
v
of typeT
orconst T
, […]
Then 23.2.2.5 [container.alloc.reqmts] bullet (2.4) says:
T
is Cpp17CopyInsertable intoX
means that, in addition toT
being Cpp17MoveInsertable intoX
, the following expression is well-formed:allocator_traits<A>::construct(m, p, v)
So, what is the value category of the expression v
? We didn't explicitly phrase the wording.
The intent may be that the value category of v
is any defined value category in 7.2.1 [basic.lval],
however, the intent is not clear in the current wording. Maybe, we can say:
[…] the following expression is well-formed:
allocator_traits<A>::construct(m, p, v)for
v
of any value category.
which can make the intent meaning clearer.
[2023-10-27; Reflector poll]
Set status to Tentatively Ready after five votes in favour during reflector poll.
[2023-11-11 Approved at November 2023 meeting in Kona. Status changed: Voting → WP.]
Proposed resolution:
This wording is relative to N4950.
Modify 23.2.2.5 [container.alloc.reqmts] as indicated:
-2- Given an allocator type
A
and given a container typeX
having avalue_type
identical toT
and anallocator_type
identical toallocator_traits<A>::rebind_alloc<T>
and given an lvaluem
of typeA
, a pointerp
of typeT*
, an expressionv
that denotes an lvalue of typeT
orconst T
or an rvalue of typeconst T
, and an rvaluerv
of typeT
, the following terms are defined. […]
[…]
(2.3) —
T
is Cpp17MoveInsertable intoX
means that the following expression is well-formed:allocator_traits<A>::construct(m, p, rv)and its evaluation causes the following postcondition to hold: The value of
[Note 1:*p
is equivalent to the value ofrv
before the evaluation.rv
remains a valid object. Its state is unspecified — end note](2.4) —
T
is Cpp17CopyInsertable intoX
means that, in addition toT
being Cpp17MoveInsertable intoX
, the following expression is well-formed:allocator_traits<A>::construct(m, p, v)and its evaluation causes the following postcondition to hold: The value of
v
is unchanged and is equivalent to*p
.[…]