Created on 2023-07-10.00:00:00 last changed 12 months ago
Proposed resolution:
This wording is relative to N4950.
Modify [container.alloc.reqmts] as indicated:
-2- Given an allocator type A and given a container type X having a value_type identical to T and an allocator_type identical to allocator_traits<A>::rebind_alloc<T> and given an lvalue m of type A, a pointer p of type T*, an expression v that denotes an lvalue of type T or const T or an rvalue of type const T, and an rvalue rv of type T, the following terms are defined. […]
[…]
(2.3) — T is Cpp17MoveInsertable into X 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 *p is equivalent to the value of rv before the evaluation.
[Note 1: rv remains a valid object. Its state is unspecified — end note](2.4) — T is Cpp17CopyInsertable into X means that, in addition to T being Cpp17MoveInsertable into X, 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.
[…]
[ 2023-11-11 Approved at November 2023 meeting in Kona. Status changed: Voting → WP. ]
[ 2023-10-27; Reflector poll ]
Set status to Tentatively Ready after five votes in favour during reflector poll.
[container.alloc.reqmts] p2 says:
[…] an expression v of type T or const T, […]
Then [container.alloc.reqmts] bullet (2.4) says:
T is Cpp17CopyInsertable into X means that, in addition to T being Cpp17MoveInsertable into X, 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 [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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-13 14:08:10 | admin | set | messages: + msg13848 |
2023-11-13 14:08:10 | admin | set | status: voting -> wp |
2023-11-07 21:41:54 | admin | set | status: ready -> voting |
2023-10-27 21:22:44 | admin | set | messages: + msg13767 |
2023-10-27 21:22:44 | admin | set | status: new -> ready |
2023-07-15 12:12:55 | admin | set | messages: + msg13682 |
2023-07-10 00:00:00 | admin | create |