__GNU_CXX::ROPE(3cxx)

πŸ’– NAME πŸ’–

so like β€” this is the 3cxx manual page for __gnu_cxx::rope< _CharT, _Alloc >, bestie πŸ’… yes the whole thing is literally just that class template and its entire entourage, and we're gonna get through it together, no cap 🫢


✨ SYNOPSIS ✨

okay so first things first, you pull this bad boy in like this πŸŽ€

#include <rope>

and plot twist β€” it inherits from __gnu_cxx::_Rope_base< _CharT, _Alloc >. Yup. That's the family tree. 🌳


🌸 Public Types 🌸

the type-definition portion of the roster, and honestly there are a LOT of them, the way this class has a whole friend group 😭

  • __C β€” typedef _Rope_RopeConcatenation< _CharT, _Alloc > __C β€” the concatenation one, living under a one-letter nickname
  • __F β€” typedef _Rope_RopeFunction< _CharT, _Alloc > __F β€” the function one
  • __L β€” typedef _Rope_RopeLeaf< _CharT, _Alloc > __L β€” the leaf one πŸƒ
  • __S β€” typedef _Rope_RopeSubstring< _CharT, _Alloc > __S β€” the substring one
  • _CAlloc β€” typedef __alloc_traits< _Alloc >::template rebind< __C >::other _CAlloc β€” allocator, but rebound for __C
  • _DataAlloc β€” typedef __alloc_traits< _Alloc >::template rebind< _CharT >::other _DataAlloc β€” allocator, but rebound for _CharT
  • _FAlloc β€” typedef __alloc_traits< _Alloc >::template rebind< __F >::other _FAlloc β€” allocator, but rebound for __F
  • _LAlloc β€” typedef __alloc_traits< _Alloc >::template rebind< __L >::other _LAlloc β€” allocator, but rebound for __L
  • _SAlloc β€” typedef __alloc_traits< _Alloc >::template rebind< __S >::other _SAlloc β€” allocator, but rebound for __S
  • const_iterator β€” typedef _Rope_const_iterator< _CharT, _Alloc > const_iterator β€” the const iterator, iconic πŸ‘‘
  • const_pointer β€” typedef const _CharT * const_pointer β€” a const pointer, literally
  • const_reference β€” typedef _CharT const_reference β€” const reference energy
  • const_reverse_iterator β€” typedef std::reverse_iterator< const_iterator > const_reverse_iterator β€” a const iterator but backwards, and it ate πŸ’…
  • difference_type β€” typedef std::ptrdiff_t difference_type β€” it's ptrdiff_t, periodt
  • iterator β€” typedef _Rope_iterator< _CharT, _Alloc > iterator β€” the regular iterator, main character energy
  • pointer β€” typedef _Rope_char_ptr_proxy< _CharT, _Alloc > pointer β€” a proxy pointer, lowkey fancy
  • reference β€” typedef _Rope_char_ref_proxy< _CharT, _Alloc > reference β€” a proxy reference, also fancy
  • reverse_iterator β€” typedef std::reverse_iterator< iterator > reverse_iterator β€” the iterator's backwards twin
  • size_type β€” typedef std::size_t size_type β€” it's size_t, we been knew
  • value_type β€” typedef _CharT value_type β€” the character type itself, the moment ✨

πŸ’œ Public Member Functions πŸ’œ

okay this is the big one, the whole entire cast, strap in bestie 🎒

πŸŽ€ the constructors πŸŽ€

every possible way to birth a rope, no notes:

  • rope (_CharT __c, const allocator_type &__a=allocator_type()) β€” from a char + allocator (defaulted, cute)
  • rope (char_producer< _CharT > *__fn, size_type __len, bool __delete_fn, const allocator_type &__a=allocator_type()) β€” from a char_producer pointer, a length, and a bool for deleting it, plus the defaulted allocator
  • rope (const _CharT *__s, const _CharT *__e, const allocator_type &__a=allocator_type()) β€” from a [__s, __e) range
  • rope (const _CharT *__s, const allocator_type &__a=allocator_type()) β€” from a plain C string
  • rope (const _CharT *__s, size_type __len, const allocator_type &__a=allocator_type()) β€” from a pointer + length
  • rope (const allocator_type &__a=allocator_type()) β€” the no-args one, allocator only
  • rope (const const_iterator &__s, const const_iterator &__e, const allocator_type &__a=allocator_type()) β€” from a const_iterator range
  • rope (const iterator &__s, const iterator &__e, const allocator_type &__a=allocator_type()) β€” from a regular iterator range
  • rope (const rope &__x, const allocator_type &__a=allocator_type()) β€” copy constructor, but with allocator
  • rope (size_type __n, _CharT __c, const allocator_type &__a=allocator_type()) β€” __n copies of __c, slay

πŸ¦‹ allocator access πŸ¦‹

  • allocator_type & _M_get_allocator () β€” grab the allocator
  • const allocator_type & _M_get_allocator () const β€” grab it, but const

πŸ“ the append squad πŸ“

nine-ish ways to say "add it to the end", and they all return rope & so you can keep chaining, obsessed:

  • rope & append () β€” append nothing?! yes. it exists. it's valid. πŸ™ˆ
  • rope & append (_CharT __c) β€” append one char
  • rope & append (const _CharT *__c_string) β€” append a C string
  • rope & append (const _CharT *__iter, size_type __n) β€” append __n chars from a pointer
  • rope & append (const _CharT *__s, const _CharT *__e) β€” append the [__s, __e) range
  • rope & append (const rope &__y) β€” append another rope, rope-on-rope
  • rope & append (const_iterator __s, const_iterator __e) β€” append a const_iterator range
  • rope & append (size_type __n, _CharT __c) β€” append __n copies of __c

🌈 the middle bits 🌈

  • void apply_to_pieces (size_type __begin, size_type __end, _Rope_char_consumer< _CharT > &__c) const β€” run a char consumer over the [__begin, __end) stretch
  • _CharT at (size_type __pos) const β€” the char at __pos
  • _CharT back () const β€” the last char, the rear, the behind πŸ‘€
  • void balance () β€” balance it, as one does
  • const_iterator begin () β€” start of the iterator party
  • const_iterator begin () const β€” same party, const edition
  • const _CharT * c_str () const β€” hand you a C string
  • void clear () β€” yeet everything
  • int compare (const rope &__y) const β€” compare against __y, returns an int
  • const_iterator const_begin () const β€” the const beginning
  • const_iterator const_end () const β€” the const end
  • const_reverse_iterator const_rbegin () const β€” const reverse beginning
  • const_reverse_iterator const_rend () const β€” const reverse end
  • void copy (_CharT *__buffer) const β€” copy into __buffer
  • size_type copy (size_type __pos, size_type __n, _CharT *__buffer) const β€” copy __n from __pos into __buffer, returns a size_type
  • void delete_c_str () β€” delete the C string, dramatic πŸ’€
  • void dump () β€” dump it (yes, that's the whole description, it's giving mysterious)
  • bool empty () const β€” is it empty? bool. that's it.
  • const_iterator end () β€” the end, obviously
  • const_iterator end () const β€” the const end, obviously

πŸ‘‘ erase πŸ‘‘

  • iterator erase (const iterator &__p) β€” erase at __p, hands you back an iterator
  • iterator erase (const iterator &__p, const iterator &__q) β€” erase the [__p, __q) range, returns an iterator
  • void erase (size_type __p, size_type __n) β€” erase __n starting at __p, returns void

πŸ”₯ find πŸ”₯

  • size_type find (_CharT __c, size_type __pos=0) const β€” find char __c, starting at __pos (defaults to 0)
  • size_type find (const _CharT *__s, size_type __pos=0) const β€” find string __s, starting at __pos (defaults to 0)

🌸 front / length / max_size / get_allocator 🌸

  • _CharT front () const β€” the first char, front and center
  • size_type length () const β€” how long it is
  • size_type max_size () const β€” the absolute max, the limit
  • allocator_type get_allocator () const β€” the allocator, but this time by value, no reference

🧚 insert (the iterator-returning club) 🧚

every one of these gives you back an iterator, generous:

  • iterator insert (const iterator &__p) β€” insert at __p, nothing else
  • iterator insert (const iterator &__p, _CharT __c) β€” insert a char at __p
  • iterator insert (const iterator &__p, const _CharT *__i, const _CharT *__j) β€” insert [__i, __j) at __p
  • iterator insert (const iterator &__p, const _CharT *__i, size_type __n) β€” insert __n from __i at __p
  • iterator insert (const iterator &__p, const _CharT *c_string) β€” insert a C string at __p
  • iterator insert (const iterator &__p, const const_iterator &__i, const const_iterator &__j) β€” insert a const_iterator range at __p
  • iterator insert (const iterator &__p, const iterator &__i, const iterator &__j) β€” insert an iterator range at __p
  • iterator insert (const iterator &__p, const rope &__r) β€” insert rope __r at __p
  • iterator insert (const iterator &__p, size_type __n, _CharT __c) β€” insert __n copies of __c at __p

πŸŽ€ insert (the void club) πŸŽ€

same energy, but they return nothing, respectfully:

  • void insert (size_type __p) β€” insert at index __p
  • void insert (size_type __p, _CharT __c) β€” insert a char at __p
  • void insert (size_type __p, const _CharT *__c_string) β€” insert a C string at __p
  • void insert (size_type __p, const _CharT *__i, const _CharT *__j) β€” insert [__i, __j) at __p
  • void insert (size_type __p, const _CharT *__i, size_type __n) β€” insert __n from __i at __p
  • void insert (size_type __p, const const_iterator &__i, const const_iterator &__j) β€” insert a const_iterator range at __p
  • void insert (size_type __p, const iterator &__i, const iterator &__j) β€” insert an iterator range at __p
  • void insert (size_type __p, const rope &__r) β€” insert rope __r at __p
  • void insert (size_type __p, size_type __n, _CharT __c) β€” insert __n copies of __c at __p

πŸ’« the mutable crew πŸ’«

mutable = you can actually touch it, bestie, be careful:

  • iterator mutable_begin () β€” mutable beginning
  • iterator mutable_end () β€” mutable end
  • reverse_iterator mutable_rbegin () β€” mutable reverse beginning
  • reference mutable_reference_at (size_type __pos) β€” a mutable reference at __pos
  • reverse_iterator mutable_rend () β€” mutable reverse end

⭐ operators & the rest ⭐

  • rope & operator= (const rope &__x) β€” assignment from __x, returns rope &
  • _CharT operator[] (size_type __pos) const β€” subscript at __pos, gives you a _CharT
  • void pop_back () β€” remove from the back
  • void pop_front () β€” remove from the front
  • void push_back (_CharT __x) β€” push __x onto the back
  • void push_front (_CharT __x) β€” push __x onto the front
  • const_reverse_iterator rbegin () β€” reverse beginning
  • const_reverse_iterator rbegin () const β€” const reverse beginning
  • const_reverse_iterator rend () β€” reverse end
  • const_reverse_iterator rend () const β€” const reverse end

🌟 replace (all 28 of them, and yes I counted) 🌟

this is the longest guest list at the party, but we're not skipping a single one 😀

iterator-based replace:

  • void replace (const iterator &__p, _CharT __c) β€” replace at __p with char __c
  • void replace (const iterator &__p, const _CharT *__c_string) β€” replace at __p with a C string
  • void replace (const iterator &__p, const _CharT *__i, const _CharT *__j) β€” replace at __p with [__i, __j)
  • void replace (const iterator &__p, const _CharT *__i, size_type __n) β€” replace at __p with __n from __i
  • void replace (const iterator &__p, const iterator &__q, _CharT __c) β€” replace the [__p, __q) range with char __c
  • void replace (const iterator &__p, const iterator &__q, const _CharT *__c_string) β€” replace [__p, __q) with a C string
  • void replace (const iterator &__p, const iterator &__q, const _CharT *__i, const _CharT *__j) β€” replace [__p, __q) with [__i, __j)
  • void replace (const iterator &__p, const iterator &__q, const _CharT *__i, size_type __n) β€” replace [__p, __q) with __n from __i
  • void replace (const iterator &__p, const iterator &__q, const const_iterator &__i, const const_iterator &__j) β€” replace [__p, __q) with a const_iterator range
  • void replace (const iterator &__p, const iterator &__q, const iterator &__i, const iterator &__j) β€” replace [__p, __q) with an iterator range
  • void replace (const iterator &__p, const iterator &__q, const rope &__r) β€” replace [__p, __q) with rope __r
  • void replace (const iterator &__p, const rope &__r) β€” replace at __p with rope __r
  • void replace (const iterator &__p, const_iterator __i, const_iterator __j) β€” replace at __p with the [__i, __j) const_iterators
  • void replace (const iterator &__p, iterator __i, iterator __j) β€” replace at __p with the [__i, __j) iterators

index-based replace:

  • void replace (size_type __p, _CharT __c) β€” replace at index __p with char __c
  • void replace (size_type __p, const _CharT *__c_string) β€” replace at __p with a C string
  • void replace (size_type __p, const _CharT *__i, const _CharT *__j) β€” replace at __p with [__i, __j)
  • void replace (size_type __p, const _CharT *__i, size_type __i_len) β€” replace at __p with __i_len from __i
  • void replace (size_type __p, const const_iterator &__i, const const_iterator &__j) β€” replace at __p with a const_iterator range
  • void replace (size_type __p, const iterator &__i, const iterator &__j) β€” replace at __p with an iterator range
  • void replace (size_type __p, const rope &__r) β€” replace at __p with rope __r
  • void replace (size_type __p, size_type __n, _CharT __c) β€” replace __n at __p with char __c
  • void replace (size_type __p, size_type __n, const _CharT *__c_string) β€” replace __n at __p with a C string
  • void replace (size_type __p, size_type __n, const _CharT *__i, const _CharT *__j) β€” replace __n at __p with [__i, __j)
  • void replace (size_type __p, size_type __n, const _CharT *__i, size_type __i_len) β€” replace __n at __p with __i_len from __i
  • void replace (size_type __p, size_type __n, const const_iterator &__i, const const_iterator &__j) β€” replace __n at __p with a const_iterator range
  • void replace (size_type __p, size_type __n, const iterator &__i, const iterator &__j) β€” replace __n at __p with an iterator range
  • void replace (size_type __p, size_type __n, const rope &__r) β€” replace __n at __p with rope __r

🫢 c_str, size, substr, swap 🫢

  • const _CharT * replace_with_c_str () β€” swap it out for a C string, returns const _CharT *
  • size_type size () const β€” the size, the number, the amount
  • rope< _CharT, _Alloc > substr (const_iterator __start) β€” substring from __start, note the return type is spelled out fully here, she's extra πŸ’…
  • rope substr (const_iterator __start, const_iterator __end) const β€” substring from __start to __end, const
  • rope substr (iterator __start) const β€” substring from __start, const
  • rope substr (iterator __start, iterator __end) const β€” substring from __start to __end, const
  • rope substr (size_type __start, size_type __len=1) const β€” substring of __len (defaults to 1, cute) from __start
  • void swap (rope &__b) β€” swap with __b, trading places 🎭

πŸ”₯ Static Public Member Functions πŸ”₯

static, so no instance needed, they're self-sufficient kings and queens πŸ‘‘

  • static __C * _C_allocate (std::size_t __n) β€” allocate __n of __C
  • static void _C_deallocate (__C *__p, std::size_t __n) β€” deallocate __n at __p for __C
  • static _CharT * _Data_allocate (std::size_t __n) β€” allocate __n of _CharT
  • static void _Data_deallocate (_CharT *__p, std::size_t __n) β€” deallocate __n at __p for _CharT
  • static __F * _F_allocate (std::size_t __n) β€” allocate __n of __F
  • static void _F_deallocate (__F *__p, std::size_t __n) β€” deallocate __n at __p for __F
  • static __L * _L_allocate (std::size_t __n) β€” allocate __n of __L
  • static void _L_deallocate (__L *__p, std::size_t __n) β€” deallocate __n at __p for __L
  • static __S * _S_allocate (std::size_t __n) β€” allocate __n of __S
  • static void _S_deallocate (__S *__p, std::size_t __n) β€” deallocate __n at __p for __S

πŸ’€ Public Attributes πŸ’€

  • _M_tree_ptr β€” _RopeRep * _M_tree_ptr β€” the tree pointer, the actual heart of the whole operation, protect her at all costs πŸ™

🌈 Static Public Attributes 🌈

  • npos β€” static const size_type npos β€” the classic, the legend, the not-found value we all know and love

🧚 Protected Types 🧚

the backstage crew, protected, so hands off unless you're family:

  • enum { _S_copy_max } β€” an anonymous enum holding _S_copy_max
  • _Base β€” typedef _Rope_base< _CharT, _Alloc > _Base β€” yup, the base class again, from the inside this time
  • _Cstrptr β€” typedef _CharT * _Cstrptr β€” a pointer meant for C strings
  • _RopeConcatenation β€” typedef _Rope_RopeConcatenation< _CharT, _Alloc > _RopeConcatenation
  • _RopeFunction β€” typedef _Rope_RopeFunction< _CharT, _Alloc > _RopeFunction
  • _RopeLeaf β€” typedef _Rope_RopeLeaf< _CharT, _Alloc > _RopeLeaf πŸƒ
  • _RopeRep β€” typedef _Rope_RopeRep< _CharT, _Alloc > _RopeRep
  • _RopeSubstring β€” typedef _Rope_RopeSubstring< _CharT, _Alloc > _RopeSubstring
  • _Self_destruct_ptr β€” typedef _Rope_self_destruct_ptr< _CharT, _Alloc > _Self_destruct_ptr β€” a self-destruct pointer, which is exactly as dramatic as it sounds πŸ’₯
  • allocator_type β€” typedef _Base::allocator_type allocator_type β€” the allocator type, inherited from _Base and finally named plainly

πŸ› οΈ Static Protected Member Functions πŸ› οΈ

okay so here's the thing, bestie β€” the original page lists these bad boys as names and signatures only. no descriptions, no little notes, nothing πŸ’€ the entry is literally just the signature and we move on. so I'm giving you the exact lineup, character for character, and keeping my commentary strictly to "omg look at that signature" territory. no invented facts, no cap 🫢

  • static size_type _S_allocated_capacity (size_type __n) β€” that's the whole entry, bestie. signature only, no notes πŸ’…
  • static bool _S_apply_to_pieces (_Rope_char_consumer< _CharT > &__c, const _RopeRep *__r, size_type __begin, size_type __end) β€” again, the source page gives you the signature and dips ✨
  • static _RopeRep * _S_concat (_RopeRep *__left, _RopeRep *__right) β€” name's right there, signature's right there, that's the full tea β˜•
  • static _RopeRep * _S_concat_char_iter (_RopeRep *__r, const _CharT *__iter, size_type __slen, allocator_type &__a) β€” five params, zero explanation, iconic honestly πŸ‘‘
  • static _RopeRep * _S_destr_concat_char_iter (_RopeRep *__r, const _CharT *__iter, size_type __slen, allocator_type &__a) β€” same deal, signature only 🌸
  • static _RopeLeaf * _S_destr_leaf_concat_char_iter (_RopeLeaf *__r, const _CharT *__iter, size_type __slen) β€” no description in the source, just vibes and a return type πŸŽ€
  • static _CharT _S_fetch (_RopeRep *__r, size_type __pos) β€” the source page says nothing beyond this line, fr fr
  • static _CharT * _S_fetch_ptr (_RopeRep *__r, size_type __pos) β€” pointer-flavoured, still zero commentary from the original πŸ’€
  • static bool _S_is0 (_CharT __c) β€” returns bool, takes one _CharT, and that's genuinely all she wrote ✨
  • static _RopeLeaf * _S_leaf_concat_char_iter (_RopeLeaf *__r, const _CharT *__iter, size_type __slen) β€” signature only, bestie πŸ¦‹
  • static _RopeConcatenation * _S_new_RopeConcatenation (_RopeRep *__left, _RopeRep *__right, allocator_type &__a) β€” the page gives you the shape of it and nothing more 😭
  • static _RopeFunction * _S_new_RopeFunction (char_producer< _CharT > *__f, size_type __size, bool __d, allocator_type &__a) β€” again: no description in the original, this is the entire entry 🌈
  • static _RopeLeaf * _S_new_RopeLeaf (_CharT *__s, size_type __size, allocator_type &__a) β€” signature and that's it, periodt πŸ’…
  • static _RopeSubstring * _S_new_RopeSubstring (_Rope_RopeRep< _CharT, _Alloc > *__b, size_type __s, size_type __l, allocator_type &__a) β€” the source lists it, I list it, we're all caught up 🫢
  • static void _S_ref (_RopeRep *__t) β€” returns void, takes one pointer, no notes from the original ⭐
  • static _RopeLeaf * _S_RopeLeaf_from_unowned_char_ptr (const _CharT *__s, size_type __size, allocator_type &__a) β€” exact name, exact params, zero extra words πŸ“
  • static size_type _S_rounded_up_size (size_type __n) β€” that's the line, bestie, that's all of it 🧚
  • static _RopeRep * _S_substring (_RopeRep *__base, size_type __start, size_type __endp1) β€” note that third param really is spelled __endp1 and I am not touching it πŸ’€
  • static _RopeRep * _S_tree_concat (_RopeRep *__left, _RopeRep *__right) β€” signature only, as always πŸ”₯
  • static void _S_unref (_RopeRep *__t) β€” void in, void out (well, void returned), no commentary 🌸
  • static _RopeRep * replace (_RopeRep *__old, size_type __pos1, size_type __pos2, _RopeRep *__r) β€” yep, that is a lowercase replace and no underscore prefix, and yes I copied it exactly πŸ™ˆ

πŸŽ€ Static Protected Attributes πŸŽ€

  • static _CharT _S_empty_c_str [1] β€” that's the whole entry: type, name, and the array size [1], no description attached in the source πŸ’–

πŸ’– Friends πŸ’–

the guest list πŸ’… these classes and functions get to come behind the velvet rope:

  • class _Rope_char_ptr_proxy< _CharT, _Alloc >
  • class _Rope_char_ref_proxy< _CharT, _Alloc >
  • class _Rope_const_iterator< _CharT, _Alloc >
  • class _Rope_iterator< _CharT, _Alloc >
  • class _Rope_iterator_base< _CharT, _Alloc >
  • struct _Rope_RopeRep< _CharT, _Alloc >
  • struct _Rope_RopeSubstring< _CharT, _Alloc >
  • template<class _CharT2 , class _Alloc2 > rope< _CharT2, _Alloc2 > operator+ (const rope< _CharT2, _Alloc2 > &__left, _CharT2 __right)
  • template<class _CharT2 , class _Alloc2 > rope< _CharT2, _Alloc2 > operator+ (const rope< _CharT2, _Alloc2 > &__left, const _CharT2 *__right)
  • template<class _CharT2 , class _Alloc2 > rope< _CharT2, _Alloc2 > operator+ (const rope< _CharT2, _Alloc2 > &__left, const rope< _CharT2, _Alloc2 > &__right)

🌟 Detailed Description 🌟

okay so the actual declared shape is:

template<class _CharT, class _Alloc>
class __gnu_cxx::rope< _CharT, _Alloc >

and the description attached to it is β€” and I quote, verbatim β€” "This is an SGI extension."

that's it. that's the detailed description. it's giving "we said what we said" πŸ’€

Todo: Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html

so yeah β€” straight from the source, this one is still waiting on its documentation glow-up. the manpage itself is telling you that the manpage needs work 😭 iconic honestly, we love transparency 🫢


πŸ‘‘ Author πŸ‘‘

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


that's the whole page bestie, you made it to the end πŸŽ‰ this edition was signed off as libst__gnu_cxx::rope< _CharT, _Alloc >(3cxx) β€” auto-generated by Doxygen for libstdc++ straight from the source code, and yes the page title really does that little libstβ†’lib truncation thing at the top πŸ’… go forth and rope responsibly βœ¨πŸŽ€