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
vof typeTorconst T, […]
Then 23.2.2.5 [container.alloc.reqmts] bullet (2.4) says:
Tis Cpp17CopyInsertable intoXmeans that, in addition toTbeing 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
vof 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
Aand given a container typeXhaving avalue_typeidentical toTand anallocator_typeidentical toallocator_traits<A>::rebind_alloc<T>and given an lvaluemof typeA, a pointerpof typeT*, an expressionvthat denotes an lvalue of typeTorconst Tor an rvalue of typeconst T, and an rvaluervof typeT, the following terms are defined. […]
[…]
(2.3) —
Tis Cpp17MoveInsertable intoXmeans 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:*pis equivalent to the value ofrvbefore the evaluation.rvremains a valid object. Its state is unspecified — end note](2.4) —
Tis Cpp17CopyInsertable intoXmeans that, in addition toTbeing 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
vis unchanged and is equivalent to*p.[…]