|
| multiset ()=default |
|
template<typename _InputIterator > |
| multiset (_InputIterator __first, _InputIterator __last) |
|
template<typename _InputIterator > |
| multiset (_InputIterator __first, _InputIterator __last, const _Compare &__comp, const allocator_type &__a=allocator_type()) |
|
template<typename _InputIterator > |
| multiset (_InputIterator __first, _InputIterator __last, const allocator_type &__a) |
|
| multiset (const _Compare &__comp, const allocator_type &__a=allocator_type()) |
|
| multiset (const allocator_type &__a) |
|
| multiset (const multiset &)=default |
|
| multiset (const multiset &__m, const allocator_type &__a) |
|
| multiset (initializer_list< value_type > __l, const _Compare &__comp=_Compare(), const allocator_type &__a=allocator_type()) |
|
| multiset (initializer_list< value_type > __l, const allocator_type &__a) |
|
| multiset (multiset &&)=default |
|
| multiset (multiset &&__m, const allocator_type &__a) noexcept(is_nothrow_copy_constructible< _Compare >::value &&_Alloc_traits::_S_always_equal()) |
|
| ~multiset ()=default |
|
iterator | begin () const noexcept |
|
iterator | cbegin () const noexcept |
|
iterator | cend () const noexcept |
|
void | clear () noexcept |
|
template<typename _Kt > |
auto | count (const _Kt &__x) const -> decltype(_M_t._M_count_tr(__x)) |
|
size_type | count (const key_type &__x) const |
|
reverse_iterator | crbegin () const noexcept |
|
reverse_iterator | crend () const noexcept |
|
template<typename... _Args> |
iterator | emplace (_Args &&... __args) |
|
template<typename... _Args> |
iterator | emplace_hint (const_iterator __pos, _Args &&... __args) |
|
bool | empty () const noexcept |
|
iterator | end () const noexcept |
|
template<typename _Kt > |
auto | equal_range (const _Kt &__x) -> decltype(pair< iterator, iterator >(_M_t._M_equal_range_tr(__x))) |
|
template<typename _Kt > |
auto | equal_range (const _Kt &__x) const -> decltype(pair< iterator, iterator >(_M_t._M_equal_range_tr(__x))) |
|
std::pair< iterator, iterator > | equal_range (const key_type &__x) |
|
std::pair< const_iterator, const_iterator > | equal_range (const key_type &__x) const |
|
size_type | erase (const key_type &__x) |
|
_GLIBCXX_ABI_TAG_CXX11 iterator | erase (const_iterator __first, const_iterator __last) |
|
_GLIBCXX_ABI_TAG_CXX11 iterator | erase (const_iterator __position) |
|
template<typename _Kt > |
auto | find (const _Kt &__x) -> decltype(iterator{_M_t._M_find_tr(__x)}) |
|
template<typename _Kt > |
auto | find (const _Kt &__x) const -> decltype(const_iterator{_M_t._M_find_tr(__x)}) |
|
iterator | find (const key_type &__x) |
|
const_iterator | find (const key_type &__x) const |
|
allocator_type | get_allocator () const noexcept |
|
template<typename _InputIterator > |
void | insert (_InputIterator __first, _InputIterator __last) |
|
iterator | insert (const value_type &__x) |
|
iterator | insert (const_iterator __position, const value_type &__x) |
|
iterator | insert (const_iterator __position, value_type &&__x) |
|
void | insert (initializer_list< value_type > __l) |
|
iterator | insert (value_type &&__x) |
|
key_compare | key_comp () const |
|
template<typename _Kt > |
auto | lower_bound (const _Kt &__x) -> decltype(iterator(_M_t._M_lower_bound_tr(__x))) |
|
template<typename _Kt > |
auto | lower_bound (const _Kt &__x) const -> decltype(iterator(_M_t._M_lower_bound_tr(__x))) |
|
iterator | lower_bound (const key_type &__x) |
|
const_iterator | lower_bound (const key_type &__x) const |
|
size_type | max_size () const noexcept |
|
multiset & | operator= (const multiset &)=default |
|
multiset & | operator= (initializer_list< value_type > __l) |
|
multiset & | operator= (multiset &&)=default |
|
reverse_iterator | rbegin () const noexcept |
|
reverse_iterator | rend () const noexcept |
|
size_type | size () const noexcept |
|
void | swap (multiset &__x) noexcept(/*conditional */) |
|
template<typename _Kt > |
auto | upper_bound (const _Kt &__x) -> decltype(iterator(_M_t._M_upper_bound_tr(__x))) |
|
template<typename _Kt > |
auto | upper_bound (const _Kt &__x) const -> decltype(iterator(_M_t._M_upper_bound_tr(__x))) |
|
iterator | upper_bound (const key_type &__x) |
|
const_iterator | upper_bound (const key_type &__x) const |
|
value_compare | value_comp () const |
|
template<typename _Key, typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<_Key>>
class std::multiset< _Key, _Compare, _Alloc >
A standard container made up of elements, which can be retrieved in logarithmic time.
- Template Parameters
-
_Key | Type of key objects. |
_Compare | Comparison function object type, defaults to less<_Key>. |
_Alloc | Allocator type, defaults to allocator<_Key>. |
Meets the requirements of a container, a reversible container, and an associative container (using equivalent keys). For a multiset<Key>
the key_type and value_type are Key.
Multisets support bidirectional iterators.
The private tree data is declared exactly the same way for set and multiset; the distinction is made entirely in how the tree functions are called (*_unique versus *_equal, same as the standard).
Definition at line 96 of file stl_multiset.h.
template<typename _Key , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<_Key>>
template<typename _InputIterator >
std::multiset< _Key, _Compare, _Alloc >::multiset |
( |
_InputIterator |
__first, |
|
|
_InputIterator |
__last |
|
) |
| |
|
inline |
Builds a multiset from a range.
- Parameters
-
__first | An input iterator. |
__last | An input iterator. |
Create a multiset consisting of copies of the elements from [first,last). This is linear in N if the range is already sorted, and NlogN otherwise (where N is distance(__first,__last)).
Definition at line 187 of file stl_multiset.h.
template<typename _Key , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<_Key>>
template<typename _InputIterator >
std::multiset< _Key, _Compare, _Alloc >::multiset |
( |
_InputIterator |
__first, |
|
|
_InputIterator |
__last, |
|
|
const _Compare & |
__comp, |
|
|
const allocator_type & |
__a = allocator_type() |
|
) |
| |
|
inline |
Builds a multiset from a range.
- Parameters
-
__first | An input iterator. |
__last | An input iterator. |
__comp | A comparison functor. |
__a | An allocator object. |
Create a multiset consisting of copies of the elements from [__first,__last). This is linear in N if the range is already sorted, and NlogN otherwise (where N is distance(__first,__last)).
Definition at line 203 of file stl_multiset.h.
template<typename _Key , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<_Key>>
template<typename... _Args>
iterator std::multiset< _Key, _Compare, _Alloc >::emplace |
( |
_Args &&... |
__args | ) |
|
|
inline |
Builds and inserts an element into the multiset.
- Parameters
-
__args | Arguments used to generate the element instance to be inserted. |
- Returns
- An iterator that points to the inserted element.
This function inserts an element into the multiset. Contrary to a std::set the multiset does not rely on unique keys and thus multiple copies of the same element can be inserted.
Insertion requires logarithmic time.
Definition at line 457 of file stl_multiset.h.
template<typename _Key , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<_Key>>
template<typename... _Args>
iterator std::multiset< _Key, _Compare, _Alloc >::emplace_hint |
( |
const_iterator |
__pos, |
|
|
_Args &&... |
__args |
|
) |
| |
|
inline |
Builds and inserts an element into the multiset.
- Parameters
-
__pos | An iterator that serves as a hint as to where the element should be inserted. |
__args | Arguments used to generate the element instance to be inserted. |
- Returns
- An iterator that points to the inserted element.
This function inserts an element into the multiset. Contrary to a std::set the multiset does not rely on unique keys and thus multiple copies of the same element can be inserted.
Note that the first parameter is only a hint and can potentially improve the performance of the insertion process. A bad hint would cause no gains in efficiency.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints for more on hinting.
Insertion requires logarithmic time (if the hint is not taken).
Definition at line 483 of file stl_multiset.h.
template<typename _Key , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<_Key>>
_GLIBCXX_ABI_TAG_CXX11 iterator std::multiset< _Key, _Compare, _Alloc >::erase |
( |
const_iterator |
__position | ) |
|
|
inline |
Erases an element from a multiset.
- Parameters
-
__position | An iterator pointing to the element to be erased. |
- Returns
- An iterator pointing to the element immediately following position prior to the element being erased. If no such element exists, end() is returned.
This function erases an element, pointed to by the given iterator, from a multiset. Note that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.
Definition at line 639 of file stl_multiset.h.
template<typename _Key , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<_Key>>
iterator std::multiset< _Key, _Compare, _Alloc >::insert |
( |
const value_type & |
__x | ) |
|
|
inline |
Inserts an element into the multiset.
- Parameters
-
__x | Element to be inserted. |
- Returns
- An iterator that points to the inserted element.
This function inserts an element into the multiset. Contrary to a std::set the multiset does not rely on unique keys and thus multiple copies of the same element can be inserted.
Insertion requires logarithmic time.
Definition at line 502 of file stl_multiset.h.
Referenced by std::multiset< _Key, _Compare, _Alloc >::insert().
template<typename _Key , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<_Key>>
iterator std::multiset< _Key, _Compare, _Alloc >::insert |
( |
const_iterator |
__position, |
|
|
const value_type & |
__x |
|
) |
| |
|
inline |
Inserts an element into the multiset.
- Parameters
-
__position | An iterator that serves as a hint as to where the element should be inserted. |
__x | Element to be inserted. |
- Returns
- An iterator that points to the inserted element.
This function inserts an element into the multiset. Contrary to a std::set the multiset does not rely on unique keys and thus multiple copies of the same element can be inserted.
Note that the first parameter is only a hint and can potentially improve the performance of the insertion process. A bad hint would cause no gains in efficiency.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints for more on hinting.
Insertion requires logarithmic time (if the hint is not taken).
Definition at line 532 of file stl_multiset.h.
template<typename _Key , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<_Key>>
Swaps data with another multiset.
- Parameters
-
__x | A multiset of the same element and allocator types. |
This exchanges the elements between two multisets in constant time. (It is only swapping a pointer, an integer, and an instance of the Compare
type (which itself is often stateless and empty), so it should be quite fast.) Note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function.
Whether the allocators are swapped depends on the allocator traits.
Definition at line 437 of file stl_multiset.h.