This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.
inplace_vector::emplace
Section: 23.2.4 [sequence.reqmts] Status: WP Submitter: Arthur O'Dwyer Opened: 2024-08-26 Last modified: 2024-11-28
Priority: Not Prioritized
View other active issues in [sequence.reqmts].
View all other issues in [sequence.reqmts].
View all issues with WP 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.
[Wrocław 2024-11-23; Status changed: Voting → WP.]
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
.