Title
§[container.alloc.reqmts] The value category of v should be claimed
Status
wp
Section
[container.alloc.reqmts]
Submitter
jim x

Created on 2023-07-10.00:00:00 last changed 8 months ago

Messages

Date: 2023-11-13.14:08:10

Proposed resolution:

This wording is relative to N4950.

  1. 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. […]

    1. […]

    2. (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]

    3. (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.

    4. […]

Date: 2023-11-11.00:00:00

[ 2023-11-11 Approved at November 2023 meeting in Kona. Status changed: Voting → WP. ]

Date: 2023-10-15.00:00:00

[ 2023-10-27; Reflector poll ]

Set status to Tentatively Ready after five votes in favour during reflector poll.

Date: 2023-07-10.00:00:00

[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:10adminsetmessages: + msg13848
2023-11-13 14:08:10adminsetstatus: voting -> wp
2023-11-07 21:41:54adminsetstatus: ready -> voting
2023-10-27 21:22:44adminsetmessages: + msg13767
2023-10-27 21:22:44adminsetstatus: new -> ready
2023-07-15 12:12:55adminsetmessages: + msg13682
2023-07-10 00:00:00admincreate