inplace_vector::emplace
Section: 23.2.4 [sequence.reqmts] Status: Tentatively Ready Submitter: Arthur O'Dwyer Opened: 2024-08-26 Last modified: 2024-09-18
Priority: Not Prioritized
View other active issues in [sequence.reqmts].
View all other issues in [sequence.reqmts].
View all issues with Tentatively Ready status.
Discussion:
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.
[2024-09-18; Reflector poll]
Set status to Tentatively Ready after nine votes in favour during reflector poll.
Proposed resolution:
This wording is relative to N4988.
Modify 23.2.4 [sequence.reqmts] as indicated:
a.emplace(p, args)-19- Result:
-20- Preconditions:iterator
.T
is Cpp17EmplaceConstructible intoX
fromargs
. Forvector
, inplace_vector, anddeque
,T
is also Cpp17MoveInsertable intoX
and Cpp17MoveAssignable. -21- Effects: Inserts an object of typeT
constructed withstd::forward<Args>(args)...
beforep
. [Note 1:args
can directly or indirectly refer to a value ina
. — end note] -22- Returns: An iterator that points to the new element constructed fromargs
intoa
.