Title
Precondition on inplace_vector::emplace
Status
ready
Section
[sequence.reqmts]
Submitter
Arthur O'Dwyer

Created on 2024-08-26.00:00:00 last changed 1 month ago

Messages

Date: 2024-09-18.22:30:36

Proposed resolution:

This wording is relative to N4988.

  1. Modify [sequence.reqmts] as indicated:

    a.emplace(p, args)
    

    -19- Result: iterator.

    -20- Preconditions: T is Cpp17EmplaceConstructible into X from args. For vector, inplace_vector, and deque, T is also Cpp17MoveInsertable into X and Cpp17MoveAssignable.

    -21- Effects: Inserts an object of type T constructed with std::forward<Args>(args)... before p.

    [Note 1: args can directly or indirectly refer to a value in a. — end note]

    -22- Returns: An iterator that points to the new element constructed from args into a.

Date: 2024-09-15.00:00:00

[ 2024-09-18; Reflector poll ]

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

Date: 2024-08-26.00:00:00

Inserting into the middle of an inplace_vector, just like inserting into the middle of a vector or deque, requires that we construct the new element out-of-line, shift down the trailing elements (Cpp17MoveAssignable), and then move-construct the new element into place (Cpp17MoveInsertable). P0843R14 failed to make this change, but it should have.

History
Date User Action Args
2024-09-18 22:30:36adminsetmessages: + msg14384
2024-09-18 22:30:36adminsetstatus: new -> ready
2024-09-01 08:46:08adminsetmessages: + msg14353
2024-08-26 00:00:00admincreate