std::flat_multiset::insert(3)
π std::flat_multiset::insert π
okay so this is the std::flat_multiset::insert page from the C++ Standard Libary manual, and bestie we are gonna get you through it with zero panic and maximum sparkle β¨π
πΈ NAME πΈ
std::flat_multiset::insert - std::flat_multiset::insert
β¨ Synopsis β¨
iterator insert( const value_type& value )
(1) (since C++23)
iterator insert( value_type&& value );
(2) (since C++23)
iterator insert( const_iterator pos, const value_type& value );
(3) (since C++23)
iterator insert( const_iterator pos, value_type&& value );
(4) (since C++23)
template< class InputIt >
(5) (since C++23)
void insert( InputIt first, InputIt last );
template< class InputIt >
void insert( std::sorted_equivalent_t, InputIt first, InputIt last
(6) (since C++23)
);
void insert( std::initializer_list<key_type> ilist );
(7) (since C++23)
void insert( std::sorted_equivalent_t s,
(8) (since C++23)
std::initializer_list<key_type> ilist );
π¦ Description π¦
Inserts element(s) into the container. The order of the remaining equivalent elements is preserved β no chaotic reshuffling of the girlies with equivalent keys, periodt π
- 1) Inserts
value. If the container has elements with equivalent key, inserts at the upper bound of that range. Equivalent toreturn emplace(value);. π«Ά - 2) Inserts
value. If the container has elements with equivalent key, inserts at the upper bound of that range. Equivalent toreturn emplace(std::move(value));. β¨ - 3) Inserts
valuein the position as close as possible to the position just prior topos. Equivalent toreturn emplace_hint(pos, value);. π - 4) Inserts
valuein the position as close as possible to the position just prior topos. Equivalent toreturn emplace_hint(pos, std::move(value));. πΈ - 5) Inserts elements from range
[first, last)as if performing the following operations sequentially:- Adds elements to
cas if byc.insert(c.end(), first, last);. - Sorts the range of newly inserted elements with respect to
compare. - Merges the resulting sorted range and the sorted range of pre-existing elements into a single sorted range.
- Adds elements to
May allocate memory during the in-place merge stage. lowkey important, bestie π«Ά
- 6) Inserts elements from range
[first, last). Equivalent toinsert(first, last);. π¦ - 7) Inserts elements from initializer list
ilist. Equivalent toinsert(ilist.begin(), ilist.end());. π - 8) Inserts elements from initializer list
ilist. Equivalent toinsert(s, ilist.begin(), ilist.end());. π
Information on iterator invalidation is copied from here π
π Parameters π
posβ iterator to the position before which the new element will be insertedvalueβ element value to insertfirst,lastβ range of elements to insertilistβ initializer list to insert the values fromsβ a disambiguation tag indicating that the input sequence is sorted (with respect tokey_compare)
π Type requirements π
InputItmust meet the requirements ofLegacyInputIterator.
π Return value π
- 1-4) An iterator to the inserted element.
- 5-8) (none)
π₯ Exceptions π₯
- 1-4) Depends on underlying container.
- 5-8) No exception safety guarantee.
This section is incomplete Reason: exception guarantees 1..8
β Complexity β
- 1-4) Linear.
- 5)
N + MΒ·log(M), whereNNis thesize()before the operation andMisstd::distance(first, last). - 6) Linear.
- 7)
N + MΒ·log(M), whereNNis thesize()before the operation andMisilist.size(). - 8) Linear.
This section is incomplete Reason: recheck the complexity: 1-4, 8
π Example π
This section is incomplete Reason: no example
π See also π
emplaceβ constructs element in-place (public member function)emplace_hintβ constructs elements in-place using a hint (public member function)inserterβ creates astd::insert_iteratorof type inferred from the argument (function template)
π Categories π
- Todo with reason
- Todo no example
mwah π this page came from http://cppreference.com, stamped 2024.06.10, and it is literally the std::flat_multiset::insert(3) page. bye bestie, go insert something iconic π«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms