__GNU_CXX::RB_TREE(3cxx)
πΈ NAME πΈ
okay so this is the 3cxx manual page for __gnu_cxx::rb_tree< _Key, _Value, _KeyOfValue, _Compare, _Alloc >, bestie. That's the whole name, and yes, it's giving very template-heavy main character energy. π
β¨ SYNOPSIS β¨
#include <rb_tree>
It inherits from std::_Rb_tree< _Key, _Val, _KeyOfValue, _Compare, _Alloc >. Not me inheriting the whole base class and still showing up with my own page. π
π Public Types π
__same_value_typeβ a template alias, and the exact spell is:
template<typename _Iter > using __same_value_type = is_same< value_type,
typename iterator_traits< _Iter >::value_type >
_Baseβtypedef std::_Rb_tree< _Key, _Value, _KeyOfValue, _Compare, _Alloc > _Base_Compatible_treeβtemplate<typename _Compare2 > using _Compatible_tree = _Rb_tree< _Key, _Val, _KeyOfValue, _Compare2, _Alloc >allocator_typeβtypedef _Base::allocator_type allocator_typeconst_iteratorβtypedef _Rb_tree_const_iterator< value_type > const_iteratorconst_pointerβtypedef const value_type * const_pointerconst_referenceβtypedef const value_type & const_referenceconst_reverse_iteratorβtypedef std::reverse_iterator< const_iterator > const_reverse_iteratordifference_typeβtypedef ptrdiff_t difference_typeinsert_return_typeβusing insert_return_type = _Node_insert_return< __conditional_t< is_same_v< _Key, _Val >, const_iterator, iterator >, node_type >iteratorβtypedef _Rb_tree_iterator< value_type > iteratorkey_typeβtypedef _Key key_typenode_typeβusing node_type = _Node_handle< _Key, _Val, _Node_allocator >pointerβtypedef value_type * pointerreferenceβtypedef value_type & referencereverse_iteratorβtypedef std::reverse_iterator< iterator > reverse_iteratorsize_typeβtypedef size_t size_typevalue_typeβtypedef _Val value_type
π Public Member Functions π
okay bestie, here's every public member function, in order, no skips, no cap. If the original didn't give a blurb, I'm not inventing one β signature only, periodt. π«Ά
rb_tree (const _Compare &__comp=_Compare(), const allocator_type &__a=allocator_type())bool __rb_verify () consttemplate<typename _Iterator > void _M_assign_equal (_Iterator, _Iterator)template<typename _Iterator > void _M_assign_unique (_Iterator, _Iterator)template<typename _Kt , typename _Req = __has_is_transparent_t<_Compare, _Kt>> size_type _M_count_tr (const _Kt &__k) consttemplate<typename... _Args> iterator _M_emplace_equal (_Args &&... __args)template<typename... _Args> auto _M_emplace_equal (_Args &&... __args) -> iteratortemplate<typename... _Args> iterator _M_emplace_hint_equal (const_iterator __pos, _Args &&... __args)template<typename... _Args> auto _M_emplace_hint_equal (const_iterator __pos, _Args &&... __args) -> iteratortemplate<typename... _Args> iterator _M_emplace_hint_unique (const_iterator __pos, _Args &&... __args)template<typename... _Args> auto _M_emplace_hint_unique (const_iterator __pos, _Args &&... __args) -> iteratortemplate<typename... _Args> pair< iterator, bool > _M_emplace_unique (_Args &&... __args)template<typename... _Args> auto _M_emplace_unique (_Args &&... __args) -> pair< iterator, bool >template<typename _Kt , typename _Req = __has_is_transparent_t<_Compare, _Kt>> pair< iterator, iterator > _M_equal_range_tr (const _Kt &__k)template<typename _Kt , typename _Req = __has_is_transparent_t<_Compare, _Kt>> pair< const_iterator, const_iterator > _M_equal_range_tr (const _Kt &__k) consttemplate<typename _Kt , typename _Req = __has_is_transparent_t<_Compare, _Kt>> iterator _M_find_tr (const _Kt &__k)template<typename _Kt , typename _Req = __has_is_transparent_t<_Compare, _Kt>> const_iterator _M_find_tr (const _Kt &__k) constpair< _Base_ptr, _Base_ptr > _M_get_insert_equal_pos (const key_type &__k)pair< _Base_ptr, _Base_ptr > _M_get_insert_hint_equal_pos (const_iterator __pos, const key_type &__k)pair< _Base_ptr, _Base_ptr > _M_get_insert_hint_unique_pos (const_iterator __pos, const key_type &__k)pair< _Base_ptr, _Base_ptr > _M_get_insert_unique_pos (const key_type &__k)const _Node_allocator & _M_get_Node_allocator () const noexcept_Node_allocator & _M_get_Node_allocator () noexcepttemplate<typename _Arg > iterator _M_insert_equal (_Arg &&__x)template<typename _Arg > iterator _M_insert_equal_ (const_iterator __pos, _Arg &&__x)template<typename _Arg , typename _NodeGen > iterator _M_insert_equal_ (const_iterator __pos, _Arg &&__x, _NodeGen &)template<typename _InputIterator > __enable_if_t< __same_value_type< _InputIterator >::value > _M_insert_range_equal (_InputIterator __first, _InputIterator __last)template<typename _InputIterator > __enable_if_t<!__same_value_type< _InputIterator >::value > _M_insert_range_equal (_InputIterator __first, _InputIterator __last)template<typename _InputIterator > __enable_if_t< __same_value_type< _InputIterator >::value > _M_insert_range_unique (_InputIterator __first, _InputIterator __last)template<typename _InputIterator > __enable_if_t<!__same_value_type< _InputIterator >::value > _M_insert_range_unique (_InputIterator __first, _InputIterator __last)template<typename _Arg > pair< typename _Rb_tree< _Key, _Val, _KeyOfValue, _Compare, _Alloc >::iterator, bool > _M_insert_unique (_Arg &&__v)template<typename _Arg > pair< iterator, bool > _M_insert_unique (_Arg &&__x)template<typename _Arg > iterator _M_insert_unique_ (const_iterator __pos, _Arg &&__x)template<typename _Arg , typename _NodeGen > iterator _M_insert_unique_ (const_iterator __pos, _Arg &&__x, _NodeGen &)template<typename _Kt , typename _Req = __has_is_transparent_t<_Compare, _Kt>> iterator _M_lower_bound_tr (const _Kt &__k)template<typename _Kt , typename _Req = __has_is_transparent_t<_Compare, _Kt>> const_iterator _M_lower_bound_tr (const _Kt &__k) consttemplate<typename _Compare2 > void _M_merge_equal (_Compatible_tree< _Compare2 > &__src) noexceptβ merges from a compatible container into one with equivalent keys. slay. πtemplate<typename _Compare2 > void _M_merge_unique (_Compatible_tree< _Compare2 > &__src) noexceptβ merges from a compatible container into one with unique keys. iconic.iterator _M_reinsert_node_equal (node_type &&__nh)β re-inserts an extracted node.iterator _M_reinsert_node_hint_equal (const_iterator __hint, node_type &&__nh)β re-inserts an extracted node.iterator _M_reinsert_node_hint_unique (const_iterator __hint, node_type &&__nh)β re-inserts an extracted node.insert_return_type _M_reinsert_node_unique (node_type &&__nh)β re-inserts an extracted node.template<typename _Kt , typename _Req = __has_is_transparent_t<_Compare, _Kt>> iterator _M_upper_bound_tr (const _Kt &__k)template<typename _Kt , typename _Req = __has_is_transparent_t<_Compare, _Kt>> const_iterator _M_upper_bound_tr (const _Kt &__k) constconst_iterator begin () const noexceptiterator begin () noexceptvoid clear () noexceptsize_type count (const key_type &__k) constbool empty () const noexceptconst_iterator end () const noexceptiterator end () noexceptpair< iterator, iterator > equal_range (const key_type &__k)pair< const_iterator, const_iterator > equal_range (const key_type &__k) constsize_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)_GLIBCXX_ABI_TAG_CXX11 iterator erase (iterator __position)node_type extract (const key_type &__k)β extracts a node. get that node out of here. πnode_type extract (const_iterator __pos)β extracts a node. same energy.iterator find (const key_type &__k)const_iterator find (const key_type &__k) constallocator_type get_allocator () const noexcept_Compare key_comp () constiterator lower_bound (const key_type &__k)const_iterator lower_bound (const key_type &__k) constsize_type max_size () const noexceptconst_reverse_iterator rbegin () const noexceptreverse_iterator rbegin () noexceptconst_reverse_iterator rend () const noexceptreverse_iterator rend () noexceptsize_type size () const noexceptvoid swap (_Rb_tree &__t) noexcept(/*conditional */)iterator upper_bound (const key_type &__k)const_iterator upper_bound (const key_type &__k) const
π¦ Protected Types π¦
typedef _Rb_tree_node_base * _Base_ptrtypedef const _Rb_tree_node_base * _Const_Base_ptrtypedef const _Rb_tree_node< _Val > * _Const_Link_typetypedef _Rb_tree_node< _Val > * _Link_type
πΈ Protected Member Functions πΈ
again, original gave no extra blurbs here, so we're keeping it signature-only and cute. π
_Const_Link_type _M_begin () const noexcept_Link_type _M_begin () noexcepttemplate<bool _MoveValue, typename _NodeGen > _Link_type _M_clone_node (_Link_type __x, _NodeGen &__node_gen)template<typename... _Args> void _M_construct_node (_Link_type __node, _Args &&... __args)template<typename... _Args> _Link_type _M_create_node (_Args &&... __args)void _M_destroy_node (_Link_type __p) noexceptvoid _M_drop_node (_Link_type __p) noexcept_Const_Base_ptr _M_end () const noexcept_Base_ptr _M_end () noexcept_Link_type _M_get_node ()_Const_Base_ptr _M_leftmost () const noexcept_Base_ptr & _M_leftmost () noexcept_Link_type _M_mbegin () const noexceptvoid _M_put_node (_Link_type __p) noexcept_Const_Base_ptr _M_rightmost () const noexcept_Base_ptr & _M_rightmost () noexcept_Const_Base_ptr _M_root () const noexcept_Base_ptr & _M_root () noexcept
β Static Protected Member Functions β
static const _Key & _S_key (_Const_Base_ptr __x)static const _Key & _S_key (_Const_Link_type __x)static _Link_type _S_left (_Base_ptr __x) noexceptstatic _Const_Link_type _S_left (_Const_Base_ptr __x) noexceptstatic _Base_ptr _S_maximum (_Base_ptr __x) noexceptstatic _Const_Base_ptr _S_maximum (_Const_Base_ptr __x) noexceptstatic _Base_ptr _S_minimum (_Base_ptr __x) noexceptstatic _Const_Base_ptr _S_minimum (_Const_Base_ptr __x) noexceptstatic _Link_type _S_right (_Base_ptr __x) noexceptstatic _Const_Link_type _S_right (_Const_Base_ptr __x) noexcept
π Protected Attributes π
_Rb_tree_impl< _Compare > _M_impl
π Detailed Description π
template<class _Key, class _Value, class _KeyOfValue, class _Compare, class
_Alloc = std::allocator<_Value>>
struct __gnu_cxx::rb_tree< _Key, _Value, _KeyOfValue, _Compare, _Alloc
>"This is an SGI extension.
This is an SGI extension. yep, that's the text. no notes. π
Todo: Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html
π Member Function Documentation π
okay bestie, this is the part where we go function by function. same template preamble every time, so don't panic when your eyes see _Key, _Val, _KeyOfValue, _Compare, and _Alloc = allocator<_Val> on repeat. it's giving "template couture" and we're respecting the fit. π
π«Ά _M_merge_equal
template<typename _Key , typename _Val , typename _KeyOfValue , typename
_Compare , typename _Alloc = allocator<_Val>> template<typename
_Compare2 > void std::_Rb_tree< _Key, _Val, _KeyOfValue, _Compare,
_Alloc >::_M_merge_equal (_Compatible_tree< _Compare2 > & __src)
[inline], [noexcept], [inherited]
this one merges from a compatible container into one with equivalent keys. that's the whole lore. it's [inline], [noexcept], and [inherited], so it's chill and it came from the family tree. π³
πΈ _M_merge_unique
template<typename _Key , typename _Val , typename _KeyOfValue , typename
_Compare , typename _Alloc = allocator<_Val>> template<typename
_Compare2 > void std::_Rb_tree< _Key, _Val, _KeyOfValue, _Compare,
_Alloc >::_M_merge_unique (_Compatible_tree< _Compare2 > & __src)
[inline], [noexcept], [inherited]
same merge energy, but this one is for a compatible container with unique keys. not equivalent, unique. she said "one of each, please." [inline], [noexcept], [inherited]. β¨
π¦ _M_reinsert_node_equal
template<typename _Key , typename _Val , typename _KeyOfValue , typename
_Compare , typename _Alloc = allocator<_Val>> iterator std::_Rb_tree<
_Key, _Val, _KeyOfValue, _Compare, _Alloc >::_M_reinsert_node_equal
(node_type && __nh) [inline], [inherited]
re-insert an extracted node. yes, that's it. she returns an iterator, she's [inline], she's [inherited], and she's back from her little extraction era. π
π§ _M_reinsert_node_hint_equal
template<typename _Key , typename _Val , typename _KeyOfValue , typename
_Compare , typename _Alloc = allocator<_Val>> iterator std::_Rb_tree<
_Key, _Val, _KeyOfValue, _Compare, _Alloc
>::_M_reinsert_node_hint_equal (const_iterator __hint, node_type &&
__nh) [inline], [inherited]
re-insert an extracted node, but with a const_iterator __hint and a node_type && __nh in the group chat. returns an iterator. [inline], [inherited]. the hint is right there, bestie, use it. π
π _M_reinsert_node_hint_unique
template<typename _Key , typename _Val , typename _KeyOfValue , typename
_Compare , typename _Alloc = allocator<_Val>> iterator std::_Rb_tree<
_Key, _Val, _KeyOfValue, _Compare, _Alloc
>::_M_reinsert_node_hint_unique (const_iterator __hint, node_type &&
__nh) [inline], [inherited]
the unique-keys version of re-inserting an extracted node with a hint. same const_iterator __hint, same node_type && __nh, returns an iterator, and it's [inline] plus [inherited]. unique keys said "don't duplicate the vibe." π
π _M_reinsert_node_unique
template<typename _Key , typename _Val , typename _KeyOfValue , typename
_Compare , typename _Alloc = allocator<_Val>> insert_return_type
std::_Rb_tree< _Key, _Val, _KeyOfValue, _Compare, _Alloc
>::_M_reinsert_node_unique (node_type && __nh) [inline], [inherited]
re-insert an extracted node, unique-keys department. this one returns insert_return_type instead of an iterator, and it's still [inline] and [inherited]. different return type, same "put the node back" assignment. π«
π extract β the const key_type & __k one
template<typename _Key , typename _Val , typename _KeyOfValue , typename
_Compare , typename _Alloc = allocator<_Val>> node_type std::_Rb_tree<
_Key, _Val, _KeyOfValue, _Compare, _Alloc >::extract (const key_type &
__k) [inline], [inherited]
extract a node. this overload takes const key_type & __k, returns a node_type, and is [inline] plus [inherited]. she's taking the node out of the container like "your fave is leaving the function, but she'll be back." π
β extract β the const_iterator __pos one
template<typename _Key , typename _Val , typename _KeyOfValue , typename
_Compare , typename _Alloc = allocator<_Val>> node_type std::_Rb_tree<
_Key, _Val, _KeyOfValue, _Compare, _Alloc >::extract (const_iterator
__pos) [inline], [inherited]
extract a node again, but this time you point at it with const_iterator __pos. returns node_type, [inline], [inherited]. same extract, different way to choose your main character. π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. no cap, the machine wrote this one. π€π
alright bestie, that's the page. source/version: libstdc++, generated by Doxygen from the source code, and the footer stamp is libstd__gnu_cxx::rb_...mpare, _Alloc >(3cxx) β the footer doesn't print a date, so i'm not inventing one. periodt. ππ
π¦ 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