STD::__PROFILE::UNORDERED_MAP(3cxx)

πŸ“¦
version 9.5.0 Β· 3 versions
, in ubuntu noble

πŸŽ€ NAME πŸŽ€

std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc > β€” Class std::unordered_map wrapper with performance instrumentation.

okay so bestie, quick vibe check: this is a section 3cxx manual page (that's the C++ standard library section, iykyk) and it's about a ✨special✨ unordered_map that keeps track of how your code is performing. It's giving "your map, but it's taking notes". πŸ’…


✨ SYNOPSIS ✨

#include <unordered_map>

So here's the lineage, and ngl it's a whole family tree:

Inherits unordered_map< _Key, _Tp, std::hash< _Key >, std::equal_to<
_Key >, std::allocator< std::pair< const _Key, _Tp > > >, and
std::__profile::_Unordered_profile< _UnorderedCont, _Unique_keys >.

Like, it is an unordered_map, and it also carries the profile stuff around with it. Both. At once. Iconic behaviour, honestly. πŸ¦‹


🫢 Public Types 🫢

  • typedef _Base::allocator_type allocator_type
  • typedef _Base::const_iterator const_iterator
  • typedef _Base::const_reference const_reference
  • typedef _Base::difference_type difference_type
  • typedef _Base::hasher hasher
  • typedef _Base::iterator iterator
  • typedef _Base::key_equal key_equal
  • typedef _Base::key_type key_type
  • typedef _Base::mapped_type mapped_type
  • typedef _Base::reference reference
  • typedef _Base::size_type size_type
  • typedef _Base::value_type value_type

every single one of them borrowed straight off _Base, no cap, they didn't even pretend otherwise πŸ’€


🌸 Public Member Functions 🌸

The constructor lineup (yes there's like a million of them, it's a whole roster):

  • template<typename _InputIterator > unordered_map (_InputIterator __f, _InputIterator __l, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
  • template<typename _InputIterator > unordered_map (_InputIterator __first, _InputIterator __last, size_type __n, const allocator_type &__a)
  • template<typename _InputIterator > unordered_map (_InputIterator __first, _InputIterator __last, size_type __n, const hasher &__hf, const allocator_type &__a)
  • unordered_map (const _Base &__x)
  • unordered_map (const allocator_type &__a)
  • unordered_map (const unordered_map &)=default
  • unordered_map (const unordered_map &__umap, const allocator_type &__a)
  • unordered_map (initializer_list< value_type > __l, size_type __n, const allocator_type &__a)
  • unordered_map (initializer_list< value_type > __l, size_type __n, const hasher &__hf, const allocator_type &__a)
  • unordered_map (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())
  • unordered_map (size_type __n, const allocator_type &__a)
  • unordered_map (size_type __n, const hasher &__hf, const allocator_type &__a)
  • unordered_map (size_type __n, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
  • unordered_map (unordered_map &&)=default
  • unordered_map (unordered_map &&__umap, const allocator_type &__a)

notice how some of them have =default just sitting there doing absolutely nothing but looking cute πŸŽ€

The rest of the member functions:

  • void clear () noexcept β€” wipes it, and it's noexcept, so it's not about to surprise you πŸ’…
  • template<typename... _Args> std::pair< iterator, bool > emplace (_Args &&... __args) β€” builds something in place, hands you back an iterator and a bool all wrapped up in a std::pair
  • template<typename... _Args> iterator emplace_hint (const_iterator __it, _Args &&... __args) β€” same emplace energy but you're sliding it a hint __it and getting just an iterator back
  • template<typename _InputIter > void insert (_InputIter __first, _InputIter __last) β€” inserts a whole range, returns nothing
  • template<typename _Pair , typename = typename std::enable_if<std::is_constructible<value_type, _Pair&&>::value>::type> std::pair< iterator, bool > insert (_Pair &&__obj) β€” the SFINAE one, it only exists if value_type is constructible from _Pair&&
  • std::pair< iterator, bool > insert (const value_type &__obj) β€” plain insert, gives you std::pair< iterator, bool >
  • template<typename _Pair , typename = typename std::enable_if<std::is_constructible<value_type, _Pair&&>::value>::type> iterator insert (const_iterator __iter, _Pair &&__v) β€” hinted + SFINAE'd, returns an iterator
  • iterator insert (const_iterator __iter, const value_type &__v) β€” hinted, returns an iterator
  • void insert (std::initializer_list< value_type > __l) β€” drop a whole initializer list in, returns nothing
  • unordered_map & operator= (const unordered_map &)=default
  • unordered_map & operator= (initializer_list< value_type > __l)
  • unordered_map & operator= (unordered_map &&)=default
  • mapped_type & operator[] (_Key &&__k) β€” hands back a mapped_type & for the key
  • mapped_type & operator[] (const _Key &__k) β€” same deal, const key flavour
  • void rehash (size_type __n)
  • void swap (unordered_map &__x) noexcept(noexcept(__x._M_base().swap(__x))) β€” swaps with __x, and look at that noexcept clause, it's conditional, so fancy 🌈

πŸ¦‹ Protected Member Functions πŸ¦‹

  • void _M_profile_construct () noexcept
  • void _M_profile_destruct () noexcept
  • void _M_profile_resize (std::size_t __old_size)
  • void _M_swap (_Unordered_profile &__other) noexcept

protected, so it's giving for the internals only, stay in your lane bestie πŸ™ˆ


πŸ’œ Protected Attributes πŸ’œ

  • __gnu_profile::__hashfunc_info * _M_hashfunc_info
  • __gnu_profile::__container_size_info * _M_size_info

two raw pointers, just hanging out, tracking things πŸ‘‘


πŸ”₯ Detailed Description πŸ”₯

okay so here's the actual class declaration, and listen, it's a template:

template<typename _Key, typename _Tp, typename _Hash = std::hash<_Key>,
    typename _Pred = std::equal_to<_Key>, typename _Alloc =
    std::allocator<std::pair<const _Key, _Tp> >>
    class std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >"Class std::unordered_map wrapper with performance instrumentation.

(yes the >"Class thing is really in there, I'm not editing that, it's part of the lore πŸ’€)

Definition at line 51 of file profile/unordered_map.


🌟 Member Typedef Documentation 🌟

fr fr, every single one of these is just _Base::something re-exported, but they each get their own little spotlight, so here we go:

allocator_type

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef
    _Base::allocator_type std::__profile::unordered_map< _Key, _Tp, _Hash,
    _Pred, _Alloc >::allocator_type

Definition at line 68 of file profile/unordered_map.

const_iterator

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef
    _Base::const_iterator std::__profile::unordered_map< _Key, _Tp, _Hash,
    _Pred, _Alloc >::const_iterator

Definition at line 77 of file profile/unordered_map.

const_reference

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef
    _Base::const_reference std::__profile::unordered_map< _Key, _Tp, _Hash,
    _Pred, _Alloc >::const_reference

Definition at line 73 of file profile/unordered_map.

difference_type

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef
    _Base::difference_type std::__profile::unordered_map< _Key, _Tp, _Hash,
    _Pred, _Alloc >::difference_type

Definition at line 71 of file profile/unordered_map.

hasher

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef _Base::hasher
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc >::hasher

Definition at line 66 of file profile/unordered_map.

iterator

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef _Base::iterator
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::iterator

Definition at line 76 of file profile/unordered_map.

key_equal

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef _Base::key_equal
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::key_equal

Definition at line 67 of file profile/unordered_map.

key_type

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef _Base::key_type
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::key_type

Definition at line 69 of file profile/unordered_map.

mapped_type

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef _Base::mapped_type
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::mapped_type

Definition at line 74 of file profile/unordered_map.

reference

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef _Base::reference
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::reference

Definition at line 72 of file profile/unordered_map.

size_type

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef _Base::size_type
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::size_type

Definition at line 65 of file profile/unordered_map.

value_type

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> typedef _Base::value_type
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::value_type

Definition at line 70 of file profile/unordered_map.


and that's just part one bestie, we are SO not done yet, hold on πŸ’–

✨ the shared glow-up (template header) ✨

okay bestie, before we get into the thirteen (yes THIRTEEN πŸ’€) constructors, here's the template header they ALL rock, so I don't have to type it thirteen times and you don't have to read it thirteen times. it's giving efficiency 🫢

template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >>

every single one below is std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc >::unordered_map(...) and lives in the file profile/unordered_map. two of them are also member templates with an extra template<typename _InputIterator > β€” I'll flag those when we get there. periodt πŸ’…


1. the bucket-count buffet

unordered_map(size_type __n, const hasher & __hf = hasher(),
    const key_equal & __eql = key_equal(),
    const allocator_type & __a = allocator_type())

the OGs: [inline], [explicit]. it takes a size_type __n, and then the hasher __hf, key-equal __eql and allocator __a all come with defaults (hasher(), key_equal(), allocator_type()). lowkey the whole squad is invited but nobody has to show up.

Definition at line 82 of file profile/unordered_map.

2. the iterator-range one (member template, first edition)

this one brings its own extra template line, note it:

template<typename _InputIterator >
unordered_map(_InputIterator __f, _InputIterator __l, size_type __n = 0,
    const hasher & __hf = hasher(), const key_equal & __eql = key_equal(),
    const allocator_type & __a = allocator_type())

[inline]. heads up bestie: the iterators here are named __f and __l β€” not __first/__last like the later ones, so don't go renaming them, iykyk. __n defaults to 0, and __hf, __eql, __a keep their usual defaults.

Definition at line 89 of file profile/unordered_map.

3. the one that just wants a _Base

unordered_map(const _Base & __x)

[inline]. that's it. one const _Base & __x. no defaults, no drama, main character minimalism ✨

Definition at line 98 of file profile/unordered_map.

4. the allocator-only era

unordered_map(const allocator_type & __a)

[inline], [explicit]. just hands you the allocator __a and nothing else. it's giving "I only need one thing and I'm not sorry" πŸ’…

Definition at line 104 of file profile/unordered_map.

5. the copy-with-allocator

unordered_map(const unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc > & __umap,
    const allocator_type & __a)

[inline]. takes a const reference to another unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc > called __umap, plus an allocator __a. so it's the same map but with your allocator. iconic.

Definition at line 107 of file profile/unordered_map.

6. the move-with-allocator

unordered_map(unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc > && __umap,
    const allocator_type & __a)

[inline]. same as above but __umap is an rvalue reference (&&) this time, plus the allocator __a. it's the glowy anime version of #5 πŸ”₯

Definition at line 111 of file profile/unordered_map.

7. the initializer_list deluxe

unordered_map(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]. initializer_list< value_type > __l up front, then __n = 0, then __hf = hasher(), __eql = key_equal(), __a = allocator_type(). the full send πŸŽ€

Definition at line 115 of file profile/unordered_map.

8. the n-and-allocator duo

unordered_map(size_type __n, const allocator_type & __a)

[inline]. size_type __n and the allocator __a. no defaults in sight, no hasher, no key-equal. clean. minimal. obsessed.

Definition at line 122 of file profile/unordered_map.

9. the n-hasher-allocator trio

unordered_map(size_type __n, const hasher & __hf, const allocator_type & __a)

[inline]. __n, __hf, __a β€” the hasher slid into the group chat this time. still no key-equal, we keep it ✨exclusive✨.

Definition at line 126 of file profile/unordered_map.

10. the iterator-range one (member template, second edition)

extra template line again, don't skip it:

template<typename _InputIterator >
unordered_map(_InputIterator __first, _InputIterator __last, size_type __n,
    const allocator_type & __a)

[inline]. and NOW the iterators are named __first and __last (told you they'd switch up on you 😭), plus __n and the allocator __a. no defaults here, everything must be handed over explicitly.

Definition at line 132 of file profile/unordered_map.

11. the iterator-range one (member template, third edition)

template<typename _InputIterator >
unordered_map(_InputIterator __first, _InputIterator __last, size_type __n,
    const hasher & __hf, const allocator_type & __a)

[inline]. same as #10 but the hasher __hf joins the party between __n and __a. glow up unlocked πŸ¦‹

Definition at line 139 of file profile/unordered_map.

12. the initializer_list plus n plus allocator

unordered_map(initializer_list< value_type > __l, size_type __n,
    const allocator_type & __a)

[inline]. __l, __n, __a β€” that's the whole roster, no default values, no hasher, no key-equal.

Definition at line 145 of file profile/unordered_map.

13. the final boss πŸ’€

unordered_map(initializer_list< value_type > __l, size_type __n,
    const hasher & __hf, const allocator_type & __a)

[inline]. __l, __n, __hf, __a. the four-piece combo meal, no defaults because we're grown and we make choices. and that's a wrap on all thirteen, bestie 🌈

Definition at line 151 of file profile/unordered_map.

πŸ’– Member Function Documentation πŸ’–

okay bestie, deep breath, this is the big one. every member function of std::__profile::unordered_map and its inherited profile base _Unordered_profile lives down here, in alphabetical-ish order, with the exact signature, the exact flags, and the exact file + line it was born in. no skipping, we're reading all of them. periodt. πŸ’…


🧚 the inherited _Unordered_profile hooks 🧚

these four are the profile machinery itself, inherited by the map, all marked [inline], [protected], and β€” where the original says so β€” [noexcept]. they all come from unordered_base.h.

  • _M_profile_construct() β€” the profile-side "we exist now" hook.
template<typename _UnorderedCont , bool _Unique_keys> void
    std::__profile::_Unordered_profile< _UnorderedCont, _Unique_keys >::_M_profile_construct () [inline],  [protected],  [noexcept],  [inherited]

Definition at line 190 of file unordered_base.h.

  • _M_profile_destruct() β€” the matching "we're gone now" hook, also [inline], [protected], [noexcept], [inherited].
template<typename _UnorderedCont , bool _Unique_keys> void
    std::__profile::_Unordered_profile< _UnorderedCont, _Unique_keys >::_M_profile_destruct () [inline],  [protected],  [noexcept],  [inherited]

Definition at line 198 of file unordered_base.h.

  • _M_profile_resize(std::size_t __old_size) β€” the resize hook, and it takes std::size_t __old_size. this one is [inline], [protected], [inherited] β€” notice, no [noexcept] on this one, bestie. eyes open.
template<typename _UnorderedCont , bool _Unique_keys> void
    std::__profile::_Unordered_profile< _UnorderedCont, _Unique_keys >::_M_profile_resize (std::size_t __old_size) [inline],  [protected],  [inherited]

Definition at line 220 of file unordered_base.h.

  • _M_swap(_Unordered_profile< _UnorderedCont, _Unique_keys > & __other) β€” swap hook, [inline], [protected], [noexcept], [inherited], takes a reference to another profile of the same shape.
template<typename _UnorderedCont , bool _Unique_keys> void
    std::__profile::_Unordered_profile< _UnorderedCont, _Unique_keys >::_M_swap (_Unordered_profile< _UnorderedCont, _Unique_keys > & __other) [inline],  [protected],  [noexcept],  [inherited]

Definition at line 213 of file unordered_base.h.


🌸 the unordered_map overrides themselves 🌸

okay so every single one of these is templated on _Key, _Tp, _Hash = std::hash<_Key>, _Pred = std::equal_to<_Key>, and _Alloc = std::allocator<std::pair<const _Key, _Tp> > β€” that's the exact default list, don't let anyone tell you otherwise β€” and they all live in the file profile/unordered_map. they're all [inline]. let's go. πŸ’œ

  • clear() β€” wipes the whole thing, and it's [noexcept] so it promises not to throw drama at you.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> void
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc >::clear () [inline],  [noexcept]

Definition at line 173 of file profile/unordered_map.

  • emplace(_Args &&... __args) β€” perfect-forwarding variadic emplace, hands you back a std::pair< iterator, bool >.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> template<typename... _Args>
    std::pair< iterator, bool > std::__profile::unordered_map< _Key, _Tp,
    _Hash, _Pred, _Alloc >::emplace (_Args &&... __args) [inline]

Definition at line 182 of file profile/unordered_map.

  • emplace_hint(const_iterator __it, _Args &&... __args) β€” emplace but with a hint iterator __it to nudge it, returns an iterator.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> template<typename... _Args>
    iterator std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::emplace_hint (const_iterator __it, _Args &&... __args) [inline]

Definition at line 193 of file profile/unordered_map.

the insert family (yes, there are six of them 😭)

  • insert(_InputIter __first, _InputIter __last) β€” range insert, returns void.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> template<typename
    _InputIter > void std::__profile::unordered_map< _Key , _Tp , _Hash ,
    _Pred , _Alloc >::insert (_InputIter __first, _InputIter __last) [inline]

Definition at line 255 of file profile/unordered_map.

  • insert(_Pair && __obj) β€” the rvalue-ish _Pair overload, gated behind std::enable_if<std::is_constructible<value_type, _Pair&&>::value>::type, returns std::pair< iterator, bool >.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> template<typename _Pair ,
    typename  = typename
    std::enable_if<std::is_constructible<value_type,
    _Pair&&>::value>::type> std::pair< iterator, bool >
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc >::insert
    (_Pair && __obj) [inline]

Definition at line 232 of file profile/unordered_map.

  • insert(const value_type & __obj) β€” the plain const-ref one, returns std::pair< iterator, bool >.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> std::pair< iterator, bool >
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc >::insert
    (const value_type & __obj) [inline]

Definition at line 211 of file profile/unordered_map.

  • insert(const_iterator __iter, _Pair && __v) β€” hinted, with the same _Pair enable_if gate, returns an iterator.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> template<typename _Pair ,
    typename  = typename
    std::enable_if<std::is_constructible<value_type,
    _Pair&&>::value>::type> iterator std::__profile::unordered_map< _Key,
    _Tp, _Hash, _Pred, _Alloc >::insert (const_iterator __iter, _Pair &&
    __v) [inline]

Definition at line 245 of file profile/unordered_map.

  • insert(const_iterator __iter, const value_type & __v) β€” hinted const-ref version, returns an iterator.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> iterator
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc >::insert
    (const_iterator __iter, const value_type & __v) [inline]

Definition at line 220 of file profile/unordered_map.

  • insert(std::initializer_list< value_type > __l) β€” the braced-list one, returns void.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> void
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc >::insert
    (std::initializer_list< value_type > __l) [inline]

Definition at line 203 of file profile/unordered_map.

operators πŸŽ€

  • operator=(initializer_list< value_type > __l) β€” assign from a braced list, hands back unordered_map &.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> unordered_map &
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::operator= (initializer_list< value_type > __l) [inline]

Definition at line 164 of file profile/unordered_map.

  • operator[](_Key && __k) β€” rvalue key, gives you mapped_type &.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> mapped_type &
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::operator[] (_Key && __k) [inline]

Definition at line 273 of file profile/unordered_map.

  • operator[](const _Key & __k) β€” const-ref key, also gives you mapped_type &.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> mapped_type &
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc
    >::operator[] (const _Key & __k) [inline]

Definition at line 264 of file profile/unordered_map.

the bucket-shuffling ones πŸ¦‹

  • rehash(size_type __n) β€” takes a size_type __n and rebuilds the buckets, returns void.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> void
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc >::rehash
    (size_type __n) [inline]

Definition at line 289 of file profile/unordered_map.

  • swap(unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc > & __x) β€” swaps with __x, and it's [noexcept] so it's chill about it.
template<typename _Key , typename _Tp , typename _Hash  = std::hash<_Key>,
    typename _Pred  = std::equal_to<_Key>, typename _Alloc  =
    std::allocator<std::pair<const _Key, _Tp> >> void
    std::__profile::unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc >::swap
    (unordered_map< _Key, _Tp, _Hash, _Pred, _Alloc > & __x) [inline],
    [noexcept]

Definition at line 282 of file profile/unordered_map.


πŸ’€ Member Data Documentation πŸ’€

two protected data members, both inherited from the base, both defined in unordered_base.h, and they are the whole reason this profiling thing works at all:

  • _M_hashfunc_info β€” type __gnu_profile::__hashfunc_info*, [protected], [inherited].
template<typename _UnorderedCont , bool _Unique_keys>
    __gnu_profile::__hashfunc_info* std::__profile::_Unordered_profile<
    _UnorderedCont, _Unique_keys >::_M_hashfunc_info [protected],
    [inherited]

Definition at line 228 of file unordered_base.h.

  • _M_size_info β€” type __gnu_profile::__container_size_info*, [protected], [inherited].
template<typename _UnorderedCont , bool _Unique_keys>
    __gnu_profile::__container_size_info*
    std::__profile::_Unordered_profile< _UnorderedCont, _Unique_keys
    >::_M_size_info [protected],  [inherited]

Definition at line 227 of file unordered_base.h.


🫢 Author 🫢

Generated automatically by Doxygen for libstdc++ from the source code.

and that's a wrap on the whole page, bestie πŸŽ€ the source of all this is libstdc++, the generator is Doxygen (auto-generated straight from the source code, no human hand-wrote a single line of it), and the version/date tag is whatever that little footer at the very bottom of the page is whispering at you β€” the one that reads libststd::__profile:..._Pred, _Alloc >(3cxx) in that classic mangled-manpage way. we read every single line, every single flag, and we did not skip a one. iconic behaviour. slay. πŸ’…βœ¨

πŸ“¦ where this page comes from