STD::UNORDERED_MULTISET(3cxx)
๐ std::unordered_multiset< _Value, _Hash, _Pred, _Alloc > ๐
okay so this is the (3cxx) manual page for std::unordered_multiset< _Value, _Hash, _Pred, _Alloc > โ yes that's a whole mouthful of template parameters, no we're not scared of it, and yes we're gonna get through all six parts together bestie ๐ซถ
โจ NAME โจ
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc > โ it's a standard container, and here's the whole vibe: it's made of equivalent keys, meaning it can literally hold multiple copies of each key value (yes, like, a whole little clique of identical keys, iconic behavior honestly ๐).
And the twist that makes it this container specifically? The elements' keys are the elements themselves. The key isn't chilling off to the side somewhere โ the value is the key. main character energy, no cap ๐
โจ SYNOPSIS โจ
ok so before literally anything else, you gotta pull the header in or nothing works:
#include <unordered_set>
๐ฆ Public Types ๐ฆ
these are the little name tags every type in here wears so you don't have to spell out _Hashtable every five seconds, iykyk ๐
using node_type = typename _Hashtable::node_typeโ the node-handle type, for all your extract-and-reinsert main character moments ๐
then the plain old public typedefs โ every single one, no skipping:
typedef _Hashtable::key_type key_typeโ public typedef ๐ซถtypedef _Hashtable::value_type value_typeโ public typedef ๐ซถtypedef _Hashtable::hasher hasherโ public typedef ๐ซถtypedef _Hashtable::key_equal key_equalโ public typedef ๐ซถtypedef _Hashtable::allocator_type allocator_typeโ public typedef ๐ซถ
and now the iterator-related typedefs, aka the whole squad ๐:
typedef _Hashtable::pointer pointerโ iterator-related typedeftypedef _Hashtable::const_pointer const_pointerโ iterator-related typedeftypedef _Hashtable::reference referenceโ iterator-related typedeftypedef _Hashtable::const_reference const_referenceโ iterator-related typedeftypedef _Hashtable::iterator iteratorโ iterator-related typedeftypedef _Hashtable::const_iterator const_iteratorโ iterator-related typedeftypedef _Hashtable::local_iterator local_iteratorโ iterator-related typedeftypedef _Hashtable::const_local_iterator const_local_iteratorโ iterator-related typedeftypedef _Hashtable::size_type size_typeโ iterator-related typedeftypedef _Hashtable::difference_type difference_typeโ iterator-related typedef
๐ Public Member Functions ๐
constructor szn, let's go ๐
unordered_multiset() = defaultโ the default constructor, does exactly what it says on the tin โจtemplate<typename _InputIterator > unordered_multiset(_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type &__a)โ range constructor, allocator editiontemplate<typename _InputIterator > unordered_multiset(_InputIterator __first, _InputIterator __last, size_type __n, const hasher &__hf, const allocator_type &__a)โ range constructor but you also hand it a hashertemplate<typename _InputIterator > unordered_multiset(_InputIterator __first, _InputIterator __last, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())โ builds anunordered_multisetfrom a range, with all the defaults pre-loaded, slay ๐ซถunordered_multiset(const allocator_type &__a)โ creates anunordered_multisetwith no elements, yes it's empty on purpose, that's the vibeunordered_multiset(const unordered_multiset &) = defaultโ copy constructor, iconic copy-paste energy ๐unordered_multiset(const unordered_multiset &__umset, const allocator_type &__a)โ copy it, but with your own allocatorunordered_multiset(initializer_list<value_type> __l, size_type __n, const allocator_type &__a)โ initializer_list constructor, allocator editionunordered_multiset(initializer_list<value_type> __l, size_type __n, const hasher &__hf, const allocator_type &__a)โ initializer_list plus a hasher plus an allocatorunordered_multiset(initializer_list<value_type> __l, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())โ builds anunordered_multisetfrom aninitializer_list, defaults and all ๐unordered_multiset(size_type __n, const allocator_type &__a)โ bucket-count constructor with allocatorunordered_multiset(size_type __n, const hasher &__hf, const allocator_type &__a)โ bucket-count constructor with hasher and allocatorunordered_multiset(size_type __n, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())โ default constructor that creates no elements, like, zero, nada, empty bestieunordered_multiset(unordered_multiset &&) = defaultโ move constructor, zoom zoom ๐ฆunordered_multiset(unordered_multiset &&__umset, const allocator_type &__a) noexcept(noexcept(_Hashtable(std::move(__umset._M_h), __a)))โ move constructor with an allocator, and yes that wholenoexceptsandwich is part of the deal
then the bucket-y ones ๐ชฃ
size_type bucket(const key_type &__key) constโ tells you which bucket a key lands insize_type bucket_count() const noexceptโ returns the number of buckets of theunordered_multisetsize_type bucket_size(size_type __n) constโ how big is bucket number__n, bestie
iterators and clearing ๐
const_iterator cbegin() const noexceptโ const iterator to the startconst_iterator cend() const noexceptโ const iterator to the endvoid clear() noexceptโ wipes it clean ๐ญ
inserting & friends โจ
template<typename... _Args> iterator emplace(_Args &&... __args)โ builds and insert an element into theunordered_multiset, no captemplate<typename... _Args> iterator emplace_hint(const_iterator __pos, _Args &&... __args)โ inserts an element into theunordered_multiset, with a hint about wherebool empty() const noexceptโ returnstrueif theunordered_multisetis empty ๐ซฅsize_type erase(const key_type &__x)โ erases elements according to the provided key, bye booiterator erase(const_iterator __first, const_iterator __last)โ erases a[__first,__last)range of elements from anunordered_multisetnode_type extract(const key_type &__key)โ extract a node ๐node_type extract(const_iterator __pos)โ extract a node, position edition ๐allocator_type get_allocator() const noexceptโ returns the allocator object used by theunordered_multisethasher hash_function() constโ returns the hash functor object with which theunordered_multisetwas constructedtemplate<typename _InputIterator > void insert(_InputIterator __first, _InputIterator __last)โ a template function that inserts a range of elements ๐ซiterator insert(const_iterator __hint, node_type &&__nh)โ re-insert an extracted node, with a hintvoid insert(initializer_list<value_type> __l)โ inserts a list of elements into theunordered_multisetiterator insert(node_type &&__nh)โ re-insert an extracted node, no hint neededkey_equal key_eq() constโ returns the key comparison object with which theunordered_multisetwas constructed
load factor & capacity stuff ๐ฅ
float load_factor() const noexceptโ returns the average number of elements per bucketsize_type max_bucket_count() const noexceptโ returns the maximum number of buckets of theunordered_multisetfloat max_load_factor() const noexceptโ returns a positive number that theunordered_multisettries to keep the load factor less than or equal tovoid max_load_factor(float __z)โ change theunordered_multisetmaximum load factorsize_type max_size() const noexceptโ returns the maximum size of theunordered_multiset
merge, and yes there's a whole set of them ๐ฏ
template<typename _H2 , typename _P2 > void merge(unordered_multiset< _Value, _H2, _P2, _Alloc > &&__source)โ merge from an rvalueunordered_multisettemplate<typename _H2 , typename _P2 > void merge(unordered_multiset< _Value, _H2, _P2, _Alloc > &__source)โ merge from an lvalueunordered_multisettemplate<typename _H2 , typename _P2 > void merge(unordered_set< _Value, _H2, _P2, _Alloc > &&__source)โ merge from an rvalueunordered_settemplate<typename _H2 , typename _P2 > void merge(unordered_set< _Value, _H2, _P2, _Alloc > &__source)โ merge from an lvalueunordered_set
assignment, rehash, reserve, size, swap ๐
unordered_multiset & operator= (const unordered_multiset &)=defaultโ copy assignment operatorunordered_multiset & operator= (initializer_list<value_type> __l)โunordered_multisetlist assignment operatorunordered_multiset & operator= (unordered_multiset &&)=defaultโ move assignment operator, swoosh ๐ฆvoid rehash(size_type __n)โ may rehash theunordered_multisetvoid reserve(size_type __n)โ prepare theunordered_multisetfor a specified number of elementssize_type size() const noexceptโ returns the size of theunordered_multisetvoid swap(unordered_multiset &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))โ swaps data with anotherunordered_multiset,noexceptincantation included and everything
ok and then there's this whole crew below, still under the member-function umbrella, don't skip 'em ๐
iterator begin() noexceptโ begin, non-constconst_iterator begin() const noexceptโ begin, constiterator end() noexceptโ end, non-constconst_iterator end() const noexceptโ end, const ๐ธiterator insert(const value_type &__x)โ inserts an element into theunordered_multisetiterator insert(value_type &&__x)โ inserts an element into theunordered_multisetiterator insert(const_iterator __hint, const value_type &__x)โ inserts an element into theunordered_multiset, hint firstiterator insert(const_iterator __hint, value_type &&__x)โ inserts an element into theunordered_multiset, hint first, rvalue seconditerator erase(const_iterator __position)โ erases an element from anunordered_multisetiterator erase(iterator __position)โ erases an element from anunordered_multisetiterator find(const key_type &__x)โ tries to locate an element in anunordered_multiset๐template<typename _Kt > auto find(const _Kt &__x) -> decltype(_M_h._M_find_tr(__x))โ tries to locate an element in anunordered_multiset, transparentlyconst_iterator find(const key_type &__x) constโ tries to locate an element in anunordered_multiset, consttemplate<typename _Kt > auto find(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x))โ tries to locate an element in anunordered_multiset, const and transparentsize_type count(const key_type &__x) constโ finds the number of elements ๐ขtemplate<typename _Kt > auto count(const _Kt &__x) const -> decltype(_M_h._M_count_tr(__x))โ finds the number of elements, transparentlybool contains(const key_type &__x) constโ finds whether an element with the given key exists โtemplate<typename _Kt > auto contains(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x), void(), true)โ finds whether an element with the given key exists, transparentlystd::pair< iterator, iterator > equal_range(const key_type &__x)โ finds a subsequence matching given keytemplate<typename _Kt > auto equal_range(const _Kt &__x) -> decltype(_M_h._M_equal_range_tr(__x))โ finds a subsequence matching given key, transparentlystd::pair< const_iterator, const_iterator > equal_range(const key_type &__x) constโ finds a subsequence matching given key, consttemplate<typename _Kt > auto equal_range(const _Kt &__x) const -> decltype(_M_h._M_equal_range_tr(__x))โ finds a subsequence matching given key, const and transparentlocal_iterator begin(size_type __n)โ returns a read-only (constant) iterator pointing to the first bucket element ๐ชฃconst_local_iterator begin(size_type __n) constโ returns a read-only (constant) iterator pointing to the first bucket elementconst_local_iterator cbegin(size_type __n) constโ returns a read-only (constant) iterator pointing to the first bucket elementlocal_iterator end(size_type __n)โ returns a read-only (constant) iterator pointing to one past the last bucket elementsconst_local_iterator end(size_type __n) constโ returns a read-only (constant) iterator pointing to one past the last bucket elementsconst_local_iterator cend(size_type __n) constโ returns a read-only (constant) iterator pointing to one past the last bucket elements
๐ซถ Friends ๐ซถ
the friends list, literally, and you're on it bestie ๐
template<typename _Value1 , typename _Hash1 , typename _Pred1 , typename _Alloc1 > bool operator==(const unordered_multiset< _Value1, _Hash1, _Pred1, _Alloc1 > &, const unordered_multiset< _Value1, _Hash1, _Pred1, _Alloc1 > &)โ the equality comparison, templated to the maxtemplate<typename , typename , typename > class std::_Hash_merge_helperโ the merge helper, doing the behind-the-scenes work for all thosemergeoverloads ๐
๐ Detailed Description ๐
okay so picture this: a container that's literally just keys, and the keys are the elements. that's the whole vibe. and bestie โ it's a multiset, so it's not gonna gatekeep: equivalent keys can show up more than once. no "sorry, already have that one" energy. it's giving generous. it's giving abundance mindset โจ
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
class std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >
Since: C++11 โ yeah she's a modern girl, she did not exist in the olden times ๐ซถ
๐ธ Template Parameters ๐ธ
_Valueโ the type of the key objects. the main character, truly ๐_Hashโ the hashing function object type. defaults tohash<_Value>. this is the girl who decides which bucket you end up in ๐_Predโ the predicate function object type. defaults toequal_to<_Value>. she's the one asking "are you two, like, the same?" ๐_Allocโ the allocator type. defaults toallocator<_Key>. (yes, the page really does say_Keythere and not_Valueโ we're reporting, not editing ๐)
๐ฆ Requirements Check ๐ฆ
this one meets the requirements of a container, and of an unordered associative container. vibe check: passed, no notes ๐
โญ Under The Hood โญ
base is _Hashtable, dispatched at compile time via the template alias __umset_hashtable. that's it, that's the machinery. iykyk ๐ง
๐ Member Typedef Documentation ๐
so every single one of these is a typedef pulled off _Hashtable, and the template header on top of all of them is always:
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
now let's go through the whole roster, no skipping, we are thorough in this house ๐
๐ซถ Public Typedefs ๐ซถ
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::allocator_typeโ typedef of_Hashtable::allocator_typestd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::hasherโ typedef of_Hashtable::hasherstd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::key_equalโ typedef of_Hashtable::key_equalstd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::key_typeโ typedef of_Hashtable::key_typestd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::value_typeโ typedef of_Hashtable::value_type
๐ฆ Iterator-Related Typedefs ๐ฆ
okay this group is long, brace yourself bestie ๐ญ
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::const_iteratorโ typedef of_Hashtable::const_iteratorstd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::const_local_iteratorโ typedef of_Hashtable::const_local_iteratorstd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::const_pointerโ typedef of_Hashtable::const_pointerstd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::const_referenceโ typedef of_Hashtable::const_referencestd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::difference_typeโ typedef of_Hashtable::difference_typestd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::iteratorโ typedef of_Hashtable::iteratorstd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::local_iteratorโ typedef of_Hashtable::local_iteratorstd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::pointerโ typedef of_Hashtable::pointerstd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::referenceโ typedef of_Hashtable::referencestd::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::size_typeโ typedef of_Hashtable::size_type
that's 15 typedefs total btw, five public and ten iterator-related. we counted. we do not mess around ๐
โจ Constructor & Destructor Documentation โจ
๐ unordered_multiset() โ the default one ๐
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::unordered_multiset () [default]
Default constructor. that's the whole description, she's lowkey mysterious, we love that for her ๐
๐ฆ the bucket-count one ๐ฆ
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::unordered_multiset (size_type __n, const hasher & __hf = hasher(), const key_equal & __eql = key_equal(), const allocator_type & __a = allocator_type()) [inline], [explicit]
"Default constructor creates no elements." โ yes, that's literally what the page says about this one. so: no elements, zero, empty, ghost town on purpose ๐ป
Parameters:
__nโ minimal initial number of buckets ๐ชฃ__hfโ a hash functor__eqlโ a key equality functor__aโ an allocator object
๐ the range one ๐
template<typename _InputIterator >
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::unordered_multiset (_InputIterator __first, _InputIterator __last, size_type __n = 0, const hasher & __hf = hasher(), const key_equal & __eql = key_equal(), const allocator_type & __a = allocator_type()) [inline]
Builds an unordered_multiset from a range. love a container that comes pre-loaded ๐ซถ
Parameters:
__firstโ an input iterator__lastโ an input iterator__nโ minimal initial number of buckets ๐ชฃ__hfโ a hash functor__eqlโ a key equality functor__aโ an allocator object
Create an unordered_multiset consisting of copies of the elements from [__first,__last). this is linear in N, where N is distance(__first,__last). iconic, efficient, no cap ๐ฅ
๐ the copy constructor ๐
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::unordered_multiset (const unordered_multiset< _Value, _Hash, _Pred, _Alloc > &) [default]
Copy constructor. twin behaviour, literally identical ๐
โจ the move constructor โจ
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::unordered_multiset (unordered_multiset< _Value, _Hash, _Pred, _Alloc > &&) [default]
Move constructor. she's not copying, she's relocating. main character energy ๐
๐ the initializer_list one ๐
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::unordered_multiset (initializer_list< value_type > __l, size_type __n = 0, const hasher & __hf = hasher(), const key_equal & __eql = key_equal(), const allocator_type & __a = allocator_type()) [inline]
Builds an unordered_multiset from an initializer_list. the curly-brace girlies are eating today ๐
Parameters:
__lโ aninitializer_list__nโ minimal initial number of buckets ๐ชฃ__hfโ a hash functor__eqlโ a key equality functor__aโ an allocator object
Create an unordered_multiset consisting of copies of the elements in the list. this is linear in N, where N is __l.size(). slay ๐ธ
๐ the allocator-only one ๐
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::unordered_multiset (const allocator_type & __a) [inline], [explicit]
Creates an unordered_multiset with no elements. she's empty but she's custom-allocated empty, and that's a flex ๐
Parameters:
__aโ an allocator object
๐ฅ Member Function Documentation ๐ฅ
๐ฆ begin() const โ read-only era ๐ฆ
const_iterator std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::begin () const [inline], [noexcept]
Returns a read-only (constant) iterator that points to the first element in the unordered_multiset. โจ
๐ begin() โ the non-const twin ๐
iterator std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::begin () [inline], [noexcept]
Returns a read-only (constant) iterator that points to the first element in the unordered_multiset. and yes bestie, the page says "read-only (constant)" for the non-const overload too โ we are quoting, we are not editorializing ๐
๐ธ begin(size_type __n) โ bucket edition ๐ธ
local_iterator std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::begin (size_type __n) [inline]
Returns a read-only (constant) iterator pointing to the first bucket element.
Parameters:
__nโ the bucket index ๐ชฃ
Returns: a read-only local iterator ๐
๐ begin(size_type __n) const ๐
const_local_iterator std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::begin (size_type __n) const [inline]
Returns a read-only (constant) iterator pointing to the first bucket element.
Parameters:
__nโ the bucket index ๐ชฃ
Returns: a read-only local iterator ๐
๐ชฃ bucket_count() ๐ชฃ
size_type std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::bucket_count () const [inline], [noexcept]
Returns the number of buckets of the unordered_multiset. that's it. count your buckets, know your worth ๐
โญ cbegin() const โญ
const_iterator std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::cbegin () const [inline], [noexcept]
Returns a read-only (constant) iterator that points to the first element in the unordered_multiset. the "c" stands for const, as always, we been knew ๐
๐ง cbegin(size_type __n) const ๐ง
const_local_iterator std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::cbegin (size_type __n) const [inline]
Returns a read-only (constant) iterator pointing to the first bucket element.
Parameters:
__nโ the bucket index ๐ชฃ
Returns: a read-only local iterator ๐ซ
cend โ const version (whole-container vibe)
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
const_iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::cend () const
[inline], [noexcept] โจ
Gives you a read-only (constant) iterator that points one past the last element in the unordered_multiset. It's the "you've reached the end, bestie, nothing more to see here" marker ๐
Fun fact: it's referenced by std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert() โ the insert girlies are lowkey relying on it ๐
cend โ bucket version
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
const_local_iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::cend (size_type __n) const
[inline]
Returns a read-only (constant) iterator pointing to one past the last bucket elements ๐ชฃโจ
Parameters
__nโ the bucket index.
Returns
A read-only local iterator.
clear
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
void std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::clear ()
[inline], [noexcept] ๐งน
Erases all elements in an unordered_multiset. Total clean-slate main character energy โ everything gone, no notes ๐
โ ๏ธ Okay so this is important bestie: this function only erases the elements. If the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility. So likeโฆ don't blame the multiset, she just did what you asked ๐ซถ
contains โ the transparent/template one
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
template<typename _Kt>
auto std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::contains (const _Kt &__x) const
-> decltype(_M_h._M_find_tr(__x), void(), true)
[inline]
Finds whether an element with the given key exists. Yes queen, just a yes-or-no vibe check on your key ๐ฅ
Parameters
__xโ key of elements to be located.
Returns
true if there is any element with the specified key.
contains โ the key_type one
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
bool std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::contains (const key_type &__x) const
[inline]
Same deal, same energy: finds whether an element with the given key exists ๐
Parameters
__xโ key of elements to be located.
Returns
true if there is any element with the specified key.
count โ the transparent/template one
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
template<typename _Kt>
auto std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::count (const _Kt &__x) const
-> decltype(_M_h._M_count_tr(__x))
[inline]
Finds the number of elements. Because she's a *multi*set, "how many of these do you have" is a genuinely valid question and the answer can be more than one ๐๐
Parameters
__xโ element to located.
Returns
Number of elements with specified key.
count โ the key_type one
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
size_type std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::count (const key_type &__x) const
[inline]
Finds the number of elements. Same as above but takes the plain key_type โจ
Parameters
__xโ element to located.
Returns
Number of elements with specified key.
emplace
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
template<typename... _Args>
iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::emplace (_Args &&... __args)
[inline]
Builds and insert an element into the unordered_multiset โ she constructs it in place, no little temporary baby needed, iconic behaviour honestly ๐
Parameters
__argsโ arguments used to generate an element.
Returns
An iterator that points to the inserted element.
Insertion requires amortized constant time. โฑ๏ธ Slay.
emplace_hint
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
template<typename... _Args>
iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::emplace_hint (const_iterator __pos, _Args &&... __args)
[inline]
Inserts an element into the unordered_multiset, but you get to hint at where it goes ๐
Parameters
__posโ an iterator that serves as a hint as to where the element should be inserted.__argsโ arguments used to generate the element to be inserted.
Returns
An iterator that points to the inserted element.
Heads up: 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. So like, no pressure, but alsoโฆ make it a good hint bestie ๐ญ
For more on hinting, see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints
Insertion requires amortized constant time. โฑ๏ธ
empty
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
bool std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::empty () const
[inline], [noexcept]
Returns true if the unordered_multiset is empty. The vibe check. The "is she running on nothing rn" check ๐ฆ (note: noexcept, she's not gonna throw at you for asking ๐
)
end โ const version
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
const_iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::end () const
[inline], [noexcept]
Returns a read-only (constant) iterator that points one past the last element in the unordered_multiset. The finish line, the end credits, the "go home everybody" โจ
end โ non-const version
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::end ()
[inline], [noexcept]
Returns a read-only (constant) iterator that points one past the last element in the unordered_multiset โ yep, that's what the docs say for this non-const overload too, don't come for me, I'm just the messenger ๐
Referenced by std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::extract() โ extract girlies stay winning ๐
end โ bucket version, non-const
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
local_iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::end (size_type __n)
[inline]
Returns a read-only (constant) iterator pointing to one past the last bucket elements ๐ชฃ
Parameters
__nโ the bucket index.
Returns
A read-only local iterator.
end โ bucket version, const
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
const_local_iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::end (size_type __n) const
[inline]
Returns a read-only (constant) iterator pointing to one past the last bucket elements. Same bucket energy, but now she's const and behaving ๐
Parameters
__nโ the bucket index.
Returns
A read-only local iterator.
equal_range โ transparent, non-const
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
template<typename _Kt>
auto std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::equal_range (const _Kt &__x)
-> decltype(_M_h._M_equal_range_tr(__x))
[inline]
Finds a subsequence matching given key. Because multiset can hold dupes, you get a whole range of them, not just one โ she ate ๐ฅ
Parameters
__xโ key to be located.
Returns
Pair of iterators that possibly points to the subsequence matching given key.
equal_range โ transparent, const
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
template<typename _Kt>
auto std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::equal_range (const _Kt &__x) const
-> decltype(_M_h._M_equal_range_tr(__x))
[inline]
Finds a subsequence matching given key. Const flavour, same range, same slay ๐
Parameters
__xโ key to be located.
Returns
Pair of iterators that possibly points to the subsequence matching given key.
equal_range โ key_type, non-const
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
std::pair<iterator, iterator> std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::equal_range (const key_type &__x)
[inline]
Finds a subsequence matching given key. Hands you back a std::pair<iterator, iterator> โ begin-of-the-club and end-of-the-club ๐
Parameters
__xโ key to be located.
Returns
Pair of iterators that possibly points to the subsequence matching given key.
equal_range โ key_type, const
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
std::pair<const_iterator, const_iterator> std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::equal_range (const key_type &__x) const
[inline]
Finds a subsequence matching given key. Const pair version โ read-only, look but don't touch ๐ธ
Parameters
__xโ key to be located.
Returns
Pair of iterators that possibly points to the subsequence matching given key.
erase โ by key
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
size_type std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::erase (const key_type &__x)
[inline]
Erases elements according to the provided key. And because she's a multiset, this wipes out all the elements located by that key โ every last one of them ๐โจ
Parameters
__xโ key of element to be erased.
Returns
The number of elements erased.
This function erases all the elements located by the given key from an unordered_multiset.
โ ๏ธ Real talk: this function only erases the element, and 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. She is not your memory manager, bestie ๐ซถ
erase โ range
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::erase (const_iterator __first, const_iterator __last)
[inline]
Erases a [__first,__last) range of elements from an unordered_multiset. Note the square bracket on the left and the round one on the right โ __first is in, __last is not ๐
Parameters
__firstโ iterator pointing to the start of the range to be erased.__lastโ iterator pointing to the end of the range to be erased.
Returns
The iterator __last.
This function erases a sequence of elements from an unordered_multiset.
โ ๏ธ Again: this function only erases the element, and 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. No cap ๐ง
erase โ single position
template<typename _Value, typename _Hash = hash<_Value>, typename _Pred = equal_to<_Value>, typename _Alloc = allocator<_Value>>
iterator std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::erase (const_iterator __position)
[inline]
Erases an element from an unordered_multiset โ just the one, targeted, surgical, main character energy ๐ฅ
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 an unordered_multiset.
โ ๏ธ And one more time for the people in the back: this function only erases the element, and 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 โญ
๐ erase (iterator __position)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::erase (iterator
__position) [inline]
Okay so this one deletes one single element out of your unordered_multiset. Just one. Not a range, bestie, we're being surgical here ๐
Parameters
__positionโ the iterator pointing at the element you want gone โจ
Returns
An iterator pointing to the element that came immediately after __position before it got erased. And if there's no such element? You get end() back. That's it, that's the deal ๐
So like โ this function erases the element that the iterator you handed it points to, from the unordered_multiset. Simple as.
โ ๏ธ Important vibe check: this only erases the element. If the element is itself a pointer, the memory it points to is not touched in any way. Managing that pointer is your responsibility, not the container's. It is not gonna clean up after you, bestie ๐ญ
๐ฆ extract (const key_type & __key)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> node_type
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::extract (const
key_type & __key) [inline]
Extract a node ๐ซถ โ literally the whole description, that's the entire documented behaviour. Short and iconic.
๐ง extract (const_iterator __pos)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> node_type
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::extract
(const_iterator __pos) [inline]
Extract a node โจ same energy, different argument.
References: std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::end()
๐ find (const _Kt & __x) โ the transparent one
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>>
template<typename _Kt > auto std::unordered_multiset< _Value, _Hash,
_Pred, _Alloc >::find (const _Kt & __x) ->
decltype(_M_h._M_find_tr(__x))
[inline]
Tries to locate an element in an unordered_multiset ๐
Parameters
__xโ the element we're hunting for
Returns
Iterator pointing to the sought-after element, or end() if it's not found ๐ญ
So the way this works: you hand it a key, and it goes and tries to locate the element that this key matches. If it succeeds โ slay โ you get an iterator pointing right at the thing you were looking for. If it fails? You get the past-the-end (end()) iterator. Not found, no drama, just end() ๐
๐ find (const _Kt & __x) const โ same but const
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>>
template<typename _Kt > auto std::unordered_multiset< _Value, _Hash,
_Pred, _Alloc >::find (const _Kt & __x) const ->
decltype(_M_h._M_find_tr(__x))
[inline]
Tries to locate an element in an unordered_multiset ๐ (const edition, she's not changing anything)
Parameters
__xโ the element to be located
Returns
Iterator pointing to the sought-after element, or end() if not found ๐
Same whole situation as above: takes a key, tries to locate the matching element, hands you an iterator if it wins, hands you end() if it doesn't โจ
๐ find (const key_type & __x)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::find (const
key_type & __x) [inline]
Tries to locate an element in an unordered_multiset ๐
Parameters
__xโ element to be located
Returns
Iterator pointing to sought-after element, or end() if not found
Key goes in, iterator comes out (hopefully). Match found = iterator to the element. No match = past-the-end (end()) iterator. Periodt ๐
๐ find (const key_type & __x) const
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> const_iterator
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::find (const
key_type & __x) const [inline]
Tries to locate an element in an unordered_multiset ๐ธ
Parameters
__xโ element to be located
Returns
Iterator pointing to sought-after element, or end() if not found
Const-flavoured, same behaviour, still returns that past-the-end (end()) iterator when the key simply isn't there ๐
๐ get_allocator () const
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> allocator_type
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::get_allocator
() const [inline], [noexcept]
Returns the allocator object that the unordered_multiset is using ๐ซถ That's it. That's the whole function. noexcept too, so she's chill about it โจ
โญ hash_function () const
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> hasher
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::hash_function
() const [inline]
Returns the hash functor object that the unordered_multiset was constructed with ๐ So you can see exactly which hasher is running the show.
๐ฅ insert (_InputIterator __first, _InputIterator __last)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>>
template<typename _InputIterator > void std::unordered_multiset< _Value,
_Hash, _Pred, _Alloc >::insert (_InputIterator __first, _InputIterator
__last) [inline]
A template function that inserts a range of elements โจ bulk insertion era
Parameters
__firstโ iterator pointing to the start of the range to be inserted__lastโ iterator pointing to the end of the range
Complexity: similar to that of the range constructor ๐
๐ insert (const value_type & __x)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::insert (const
value_type & __x) [inline]
Inserts an element into the unordered_multiset ๐
Parameters
__xโ element to be inserted
Returns
An iterator that points to the inserted element ๐ซถ
Complexity: insertion requires amortized constant time โก
๐ธ insert (const_iterator __hint, const value_type & __x)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::insert
(const_iterator __hint, const value_type & __x) [inline]
Inserts an element into the unordered_multiset ๐
Parameters
__hintโ 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 โจ
So the tea on __hint: that first parameter is only a hint โ it can potentially improve the performance of the insertion process, but a bad hint causes no gains in efficiency ๐ญ so don't stress if yours is mid.
For more on hinting, see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints
Complexity: insertion requires amortized constant โก
๐ง insert (const_iterator __hint, node_type && __nh)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::insert
(const_iterator __hint, node_type && __nh) [inline]
Re-insert an extracted node ๐ฆ putting the node back where it belongs
References: std::move()
๐ insert (const_iterator __hint, value_type && __x)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::insert
(const_iterator __hint, value_type && __x) [inline]
Inserts an element into the unordered_multiset (move-y flavour) ๐
Parameters
__hintโ 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
Same hint situation as before, bestie: first parameter is only a hint, it can potentially improve insertion performance, and a bad hint would cause no gains in efficiency ๐
For more on hinting, see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints
Complexity: insertion requires amortized constant โก
References: std::move()
๐ insert (initializer_list<value_type> __l)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> void
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::insert
(initializer_list< value_type > __l) [inline]
Inserts a list of elements into the unordered_multiset โจ curly-brace girlies this one's for you ๐
Parameters
__lโ astd::initializer_list<value_type>of elements to be inserted
Complexity: similar to that of the range constructor ๐ซถ
โญ insert (node_type && __nh)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::insert
(node_type && __nh) [inline]
Re-insert an extracted node ๐ง no hint this time, she just goes
References: std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::cend(), and std::move()
๐ insert (value_type && __x)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> iterator
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::insert
(value_type && __x) [inline]
Inserts an element into the unordered_multiset ๐
Parameters
__xโ element to be inserted
Returns
An iterator that points to the inserted element
Complexity: insertion requires amortized constant time โก
References: std::move()
๐ฆ key_eq () const
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> key_equal
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::key_eq () const
[inline]
Returns the key comparison object that the unordered_multiset was constructed with ๐ so you can peek at whichever predicate is deciding what counts as "equal" around here.
๐ load_factor () const
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> float
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::load_factor ()
const [inline], [noexcept]
Returns the average number of elements per bucket ๐ your buckets-to-elements ratio, basically. noexcept, so no surprises โจ
๐ max_bucket_count () const
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> size_type
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc
>::max_bucket_count () const [inline], [noexcept]
Returns the maximum number of buckets of the unordered_multiset ๐ชฃ the absolute ceiling, the bucket limit, the whole thing. noexcept too ๐
๐ธ max_load_factor () const
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> float
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::max_load_factor
() const [inline], [noexcept]
Returns a positive number that the unordered_multiset tries to keep the load factor less than or equal to ๐ฏ it's the ceiling she's aiming under, not a promise, a tries. noexcept โจ
๐ฅ max_load_factor (float __z)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> void
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::max_load_factor
(float __z) [inline]
Change the unordered_multiset maximum load factor ๐ ๏ธ the setter version โ you pass in __z and that's the new ceiling she'll try to stay under. Same name, different job, iykyk ๐
Catching the tail end of the one above โ Parameters:
__zโ the new maximum load factor.
๐ max_size
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> size_type
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::max_size ()
const [inline], [noexcept]
Returns the maximum size of the unordered_multiset. That's it, that's the whole vibe โ the biggest this container could ever get. noexcept too, so she's chill about it โจ
๐ operator= (copy)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>>
unordered_multiset & std::unordered_multiset< _Value, _Hash, _Pred,
_Alloc >::operator= (const unordered_multiset< _Value, _Hash, _Pred,
_Alloc > &) [default]
Copy assignment operator. Classic. She takes the other multiset's whole personality and becomes it ๐ Defaulted, so the compiler writes the boring parts for her.
๐ธ operator= (initializer_list)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>>
unordered_multiset & std::unordered_multiset< _Value, _Hash, _Pred,
_Alloc >::operator= (initializer_list< value_type > __l) [inline]
Unordered_multiset list assignment operator โ the "here's a lil list, bestie, take it all" move ๐ซถ
Parameters
__lโ An initializer_list.
This function fills an unordered_multiset with copies of the elements in the initializer list __l.
Heads up babes: the assignment completely changes the unordered_multiset, and the resulting unordered_multiset's size is the same as the number of elements assigned. So likeโฆ nothing survives from before. Total glow-up, no leftovers โจ
๐ฆ operator= (move)
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>>
unordered_multiset & std::unordered_multiset< _Value, _Hash, _Pred,
_Alloc >::operator= (unordered_multiset< _Value, _Hash, _Pred, _Alloc >
&&) [default]
Move assignment operator. She yoinks the other one's whole existence. Defaulted, zero notes ๐
๐ฅ rehash
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> void
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::rehash
(size_type __n) [inline]
May rehash the unordered_multiset. Emphasis on may โ she's not committing to anything, it's giving conditional queen ๐
Parameters
__nโ The new number of buckets.
Rehash will occur only if the new number of buckets respect the unordered_multiset maximum load factor. No wishes, no vibes โ the load factor said no, so she's not doing it.
๐ง reserve
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> void
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::reserve
(size_type __n) [inline]
Prepare the unordered_multiset for a specified number of elements. Like packing your bag before the trip instead of panicking at the airport ๐
Parameters
__nโ Number of elements required.
Same as rehash(ceil(n / max_load_factor())). Literally that. Do the math, she already did ๐งฎ
โญ size
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> size_type
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::size () const
[inline], [noexcept]
Returns the size of the unordered_multiset. How many besties are in the group chat. const and noexcept, so she won't surprise you ๐
๐ swap
template<typename _Value , typename _Hash = hash<_Value>, typename _Pred =
equal_to<_Value>, typename _Alloc = allocator<_Value>> void
std::unordered_multiset< _Value, _Hash, _Pred, _Alloc >::swap
(unordered_multiset< _Value, _Hash, _Pred, _Alloc > & __x) [inline],
[noexcept]
Swaps data with another unordered_multiset. Two multisets, one trade, everyone eats ๐ฅ
Parameters
__xโ An unordered_multiset of the same element and allocator types. (Same element type, same allocator type โ she's picky about her company, iykyk.)
This exchanges the elements between two sets in constant time. Obsessed. And note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function โ so you can just call the global one and she'll handle it, no cap ๐ซถ
๐ Author
Generated automatically by Doxygen for libstdc++ from the source code. (Not a human, not a girlie, just a doc generator doing her lil thing ๐ )
and that's the whole page, bestie โจ This little love letter lives in thelibstdc++man pages asstd::unordered_multiset<...>(3cxx)โ same source, same version-and-date energy, just delivered with way more sparkle ๐ Go forth and multiset responsibly ๐ฆ๐
๐ฆ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms