Files
2025-10-25 03:02:53 +03:00

3.8 KiB
Raw Permalink Blame History

[flat.multiset.modifiers]

23 Containers library [containers]

23.6 Container adaptors [container.adaptors]

23.6.12 Class template flat_multiset [flat.multiset]

23.6.12.5 Modifiers [flat.multiset.modifiers]

🔗

template<class... Args> constexpr iterator emplace(Args&&... args);

1

#

Constraints: is_constructible_v<value_type, Args...> is true.

2

#

Effects: First, initializes an object t of type value_type with std::forward(args)..., then inserts t as if by:auto it = ranges::upper_bound(c, t, compare);c.insert(it, std::move(t));

3

#

Returns: An iterator that points to the inserted element.

🔗

template<class InputIterator> constexpr void insert(InputIterator first, InputIterator last);

4

#

Effects: Adds elements to c as if by:c.insert(c.end(), first, last);

Then, sorts the range of newly inserted elements with respect to compare, and merges the resulting sorted range and the sorted range of pre-existing elements into a single sorted range.

5

#

Complexity: N + MlogM, where N is size() before the operation and M is distance(first, last).

6

#

Remarks: Since this operation performs an in-place merge, it may allocate memory.

🔗

template<class InputIterator> constexpr void insert(sorted_equivalent_t, InputIterator first, InputIterator last);

7

#

Effects: Equivalent to insert(first, last).

8

#

Complexity: Linear.

🔗

constexpr void swap(flat_multiset& y) noexcept;

9

#

Effects: Equivalent to:ranges::swap(compare, y.compare); ranges::swap(c, y.c);

🔗

constexpr container_type extract() &&;

10

#

Postconditions: *this is emptied, even if the function exits via an exception.

11

#

Returns: std::move(c).

🔗

constexpr void replace(container_type&& cont);

12

#

Preconditions: The elements of cont are sorted with respect to compare.

13

#

Effects: Equivalent to: c = std::move(cont);