---
name: "__gnu_cxx::rope"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_cxx::rope"
---

# \_\_gnu\_cxx::rope(3)

## NAME

\_\_gnu\_cxx::rope\< \_CharT, \_Alloc \>

## SYNOPSIS

\#include \<rope\>

### Public Types

typedef \_Rope\_RopeConcatenation\< \_CharT, \_Alloc \> **\_\_C**\
 typedef \_Rope\_RopeFunction\< \_CharT, \_Alloc \> **\_\_F**\
 typedef \_Rope\_RopeLeaf\< \_CharT, \_Alloc \> **\_\_L**\
 typedef \_Rope\_RopeSubstring\< \_CharT, \_Alloc \> **\_\_S**\
 typedef **\_\_alloc\_traits**\< \_Alloc \>::template rebind\< \_\_C \>**::other** **\_CAlloc**\
 typedef **\_\_alloc\_traits**\< \_Alloc \>::template rebind\< \_CharT \>**::other** **\_DataAlloc**\
 typedef **\_\_alloc\_traits**\< \_Alloc \>::template rebind\< \_\_F \>**::other** **\_FAlloc**\
 typedef **\_\_alloc\_traits**\< \_Alloc \>::template rebind\< \_\_L \>**::other** **\_LAlloc**\
 typedef **\_\_alloc\_traits**\< \_Alloc \>::template rebind\< \_\_S \>**::other** **\_SAlloc**\
 typedef \_Rope\_const\_iterator\< \_CharT, \_Alloc \> **const\_iterator**\
 typedef const \_CharT \* **const\_pointer**\
 typedef \_CharT **const\_reference**\
 typedef **std::reverse\_iterator**\< const\_iterator \> **const\_reverse\_iterator**\
 typedef std::ptrdiff\_t **difference\_type**\
 typedef \_Rope\_iterator\< \_CharT, \_Alloc \> **iterator**\
 typedef \_Rope\_char\_ptr\_proxy\< \_CharT, \_Alloc \> **pointer**\
 typedef \_Rope\_char\_ref\_proxy\< \_CharT, \_Alloc \> **reference**\
 typedef **std::reverse\_iterator**\< iterator \> **reverse\_iterator**\
 typedef std::size\_t **size\_type**\
 typedef \_CharT **value\_type**\

### Public Member Functions

**rope** (\_CharT \_\_c, const allocator\_type &\_\_a=allocator\_type())\
 **rope** (char\_producer\< \_CharT \> \*\_\_fn, size\_type \_\_len, bool \_\_delete\_fn, const allocator\_type &\_\_a=allocator\_type())\
 **rope** (const \_CharT \*\_\_s, const \_CharT \*\_\_e, const allocator\_type &\_\_a=allocator\_type())\
 **rope** (const \_CharT \*\_\_s, const allocator\_type &\_\_a=allocator\_type())\
 **rope** (const \_CharT \*\_\_s, size\_type \_\_len, const allocator\_type &\_\_a=allocator\_type())\
 **rope** (const allocator\_type &\_\_a=allocator\_type())\
 **rope** (const const\_iterator &\_\_s, const const\_iterator &\_\_e, const allocator\_type &\_\_a=allocator\_type())\
 **rope** (const iterator &\_\_s, const iterator &\_\_e, const allocator\_type &\_\_a=allocator\_type())\
 **rope** (const rope &\_\_x, const allocator\_type &\_\_a=allocator\_type())\
 **rope** (size\_type \_\_n, \_CharT \_\_c, const allocator\_type &\_\_a=allocator\_type())\
 allocator\_type & **\_M\_get\_allocator** ()\
 const allocator\_type & **\_M\_get\_allocator** () const\
 rope & **append** ()\
 rope & **append** (\_CharT \_\_c)\
 rope & **append** (const \_CharT \*\_\_c\_string)\
 rope & **append** (const \_CharT \*\_\_iter, size\_type \_\_n)\
 rope & **append** (const \_CharT \*\_\_s, const \_CharT \*\_\_e)\
 rope & **append** (const rope &\_\_y)\
 rope & **append** (const\_iterator \_\_s, const\_iterator \_\_e)\
 rope & **append** (size\_type \_\_n, \_CharT \_\_c)\
 void **apply\_to\_pieces** (size\_type \_\_begin, size\_type \_\_end, \_Rope\_char\_consumer\< \_CharT \> &\_\_c) const\
 \_CharT **at** (size\_type \_\_pos) const\
 \_CharT **back** () const\
 void **balance** ()\
 const\_iterator **begin** ()\
 const\_iterator **begin** () const\
 const \_CharT \* **c\_str** () const\
 void **clear** ()\
 int **compare** (const rope &\_\_y) const\
 const\_iterator **const\_begin** () const\
 const\_iterator **const\_end** () const\
 const\_reverse\_iterator **const\_rbegin** () const\
 const\_reverse\_iterator **const\_rend** () const\
 void **copy** (\_CharT \*\_\_buffer) const\
 size\_type **copy** (size\_type \_\_pos, size\_type \_\_n, \_CharT \*\_\_buffer) const\
 void **delete\_c\_str** ()\
 void **dump** ()\
 bool **empty** () const\
 const\_iterator **end** ()\
 const\_iterator **end** () const\
 iterator **erase** (const iterator &\_\_p)\
 iterator **erase** (const iterator &\_\_p, const iterator &\_\_q)\
 void **erase** (size\_type \_\_p, size\_type \_\_n)\
 size\_type **find** (\_CharT \_\_c, size\_type \_\_pos=0) const\
 size\_type **find** (const \_CharT \*\_\_s, size\_type \_\_pos=0) const\
 \_CharT **front** () const\
 allocator\_type **get\_allocator** () const\
 iterator **insert** (const iterator &\_\_p)\
 iterator **insert** (const iterator &\_\_p, \_CharT \_\_c)\
 iterator **insert** (const iterator &\_\_p, const \_CharT \*\_\_i, const \_CharT \*\_\_j)\
 iterator **insert** (const iterator &\_\_p, const \_CharT \*\_\_i, size\_type \_\_n)\
 iterator **insert** (const iterator &\_\_p, const \_CharT \*c\_string)\
 iterator **insert** (const iterator &\_\_p, const const\_iterator &\_\_i, const const\_iterator &\_\_j)\
 iterator **insert** (const iterator &\_\_p, const iterator &\_\_i, const iterator &\_\_j)\
 iterator **insert** (const iterator &\_\_p, const rope &\_\_r)\
 iterator **insert** (const iterator &\_\_p, size\_type \_\_n, \_CharT \_\_c)\
 void **insert** (size\_type \_\_p)\
 void **insert** (size\_type \_\_p, \_CharT \_\_c)\
 void **insert** (size\_type \_\_p, const \_CharT \*\_\_c\_string)\
 void **insert** (size\_type \_\_p, const \_CharT \*\_\_i, const \_CharT \*\_\_j)\
 void **insert** (size\_type \_\_p, const \_CharT \*\_\_i, size\_type \_\_n)\
 void **insert** (size\_type \_\_p, const const\_iterator &\_\_i, const const\_iterator &\_\_j)\
 void **insert** (size\_type \_\_p, const iterator &\_\_i, const iterator &\_\_j)\
 void **insert** (size\_type \_\_p, const rope &\_\_r)\
 void **insert** (size\_type \_\_p, size\_type \_\_n, \_CharT \_\_c)\
 size\_type **length** () const\
 size\_type **max\_size** () const\
 iterator **mutable\_begin** ()\
 iterator **mutable\_end** ()\
 reverse\_iterator **mutable\_rbegin** ()\
 reference **mutable\_reference\_at** (size\_type \_\_pos)\
 reverse\_iterator **mutable\_rend** ()\
 rope & **operator=** (const rope &\_\_x)\
 \_CharT **operator\[\]** (size\_type \_\_pos) const\
 void **pop\_back** ()\
 void **pop\_front** ()\
 void **push\_back** (\_CharT \_\_x)\
 void **push\_front** (\_CharT \_\_x)\
 const\_reverse\_iterator **rbegin** ()\
 const\_reverse\_iterator **rbegin** () const\
 const\_reverse\_iterator **rend** ()\
 const\_reverse\_iterator **rend** () const\
 void **replace** (const iterator &\_\_p, \_CharT \_\_c)\
 void **replace** (const iterator &\_\_p, const \_CharT \*\_\_c\_string)\
 void **replace** (const iterator &\_\_p, const \_CharT \*\_\_i, const \_CharT \*\_\_j)\
 void **replace** (const iterator &\_\_p, const \_CharT \*\_\_i, size\_type \_\_n)\
 void **replace** (const iterator &\_\_p, const iterator &\_\_q, \_CharT \_\_c)\
 void **replace** (const iterator &\_\_p, const iterator &\_\_q, const \_CharT \*\_\_c\_string)\
 void **replace** (const iterator &\_\_p, const iterator &\_\_q, const \_CharT \*\_\_i, const \_CharT \*\_\_j)\
 void **replace** (const iterator &\_\_p, const iterator &\_\_q, const \_CharT \*\_\_i, size\_type \_\_n)\
 void **replace** (const iterator &\_\_p, const iterator &\_\_q, const const\_iterator &\_\_i, const const\_iterator &\_\_j)\
 void **replace** (const iterator &\_\_p, const iterator &\_\_q, const iterator &\_\_i, const iterator &\_\_j)\
 void **replace** (const iterator &\_\_p, const iterator &\_\_q, const rope &\_\_r)\
 void **replace** (const iterator &\_\_p, const rope &\_\_r)\
 void **replace** (const iterator &\_\_p, const\_iterator \_\_i, const\_iterator \_\_j)\
 void **replace** (const iterator &\_\_p, iterator \_\_i, iterator \_\_j)\
 void **replace** (size\_type \_\_p, \_CharT \_\_c)\
 void **replace** (size\_type \_\_p, const \_CharT \*\_\_c\_string)\
 void **replace** (size\_type \_\_p, const \_CharT \*\_\_i, const \_CharT \*\_\_j)\
 void **replace** (size\_type \_\_p, const \_CharT \*\_\_i, size\_type \_\_i\_len)\
 void **replace** (size\_type \_\_p, const const\_iterator &\_\_i, const const\_iterator &\_\_j)\
 void **replace** (size\_type \_\_p, const iterator &\_\_i, const iterator &\_\_j)\
 void **replace** (size\_type \_\_p, const rope &\_\_r)\
 void **replace** (size\_type \_\_p, size\_type \_\_n, \_CharT \_\_c)\
 void **replace** (size\_type \_\_p, size\_type \_\_n, const \_CharT \*\_\_c\_string)\
 void **replace** (size\_type \_\_p, size\_type \_\_n, const \_CharT \*\_\_i, const \_CharT \*\_\_j)\
 void **replace** (size\_type \_\_p, size\_type \_\_n, const \_CharT \*\_\_i, size\_type \_\_i\_len)\
 void **replace** (size\_type \_\_p, size\_type \_\_n, const const\_iterator &\_\_i, const const\_iterator &\_\_j)\
 void **replace** (size\_type \_\_p, size\_type \_\_n, const iterator &\_\_i, const iterator &\_\_j)\
 void **replace** (size\_type \_\_p, size\_type \_\_n, const rope &\_\_r)\
 const \_CharT \* **replace\_with\_c\_str** ()\
 size\_type **size** () const\
 rope\< \_CharT, \_Alloc \> **substr** (const\_iterator \_\_start)\
 rope **substr** (const\_iterator \_\_start, const\_iterator \_\_end) const\
 rope **substr** (iterator \_\_start) const\
 rope **substr** (iterator \_\_start, iterator \_\_end) const\
 rope **substr** (size\_type \_\_start, size\_type \_\_len=1) const\
 void **swap** (rope &\_\_b)\

### Static Public Member Functions

static \_\_C \* **\_C\_allocate** (std::size\_t \_\_n)\
 static void **\_C\_deallocate** (\_\_C \*\_\_p, std::size\_t \_\_n)\
 static \_CharT \* **\_Data\_allocate** (std::size\_t \_\_n)\
 static void **\_Data\_deallocate** (\_CharT \*\_\_p, std::size\_t \_\_n)\
 static \_\_F \* **\_F\_allocate** (std::size\_t \_\_n)\
 static void **\_F\_deallocate** (\_\_F \*\_\_p, std::size\_t \_\_n)\
 static \_\_L \* **\_L\_allocate** (std::size\_t \_\_n)\
 static void **\_L\_deallocate** (\_\_L \*\_\_p, std::size\_t \_\_n)\
 static \_\_S \* **\_S\_allocate** (std::size\_t \_\_n)\
 static void **\_S\_deallocate** (\_\_S \*\_\_p, std::size\_t \_\_n)\

### Public Attributes

\_RopeRep \* **\_M\_tree\_ptr**\

### Static Public Attributes

static const size\_type **npos**\

### Protected Types

enum { **\_S\_copy\_max** }\
 typedef \_Rope\_base\< \_CharT, \_Alloc \> **\_Base**\
 typedef \_CharT \* **\_Cstrptr**\
 typedef \_Rope\_RopeConcatenation\< \_CharT, \_Alloc \> **\_RopeConcatenation**\
 typedef \_Rope\_RopeFunction\< \_CharT, \_Alloc \> **\_RopeFunction**\
 typedef \_Rope\_RopeLeaf\< \_CharT, \_Alloc \> **\_RopeLeaf**\
 typedef \_Rope\_RopeRep\< \_CharT, \_Alloc \> **\_RopeRep**\
 typedef \_Rope\_RopeSubstring\< \_CharT, \_Alloc \> **\_RopeSubstring**\
 typedef \_Rope\_self\_destruct\_ptr\< \_CharT, \_Alloc \> **\_Self\_destruct\_ptr**\
 typedef \_Base::allocator\_type **allocator\_type**\

### Static Protected Member Functions

static size\_type **\_S\_allocated\_capacity** (size\_type \_\_n)\
 static bool **\_S\_apply\_to\_pieces** (\_Rope\_char\_consumer\< \_CharT \> &\_\_c, const \_RopeRep \*\_\_r, size\_type \_\_begin, size\_type \_\_end)\
 static \_RopeRep \* **\_S\_concat** (\_RopeRep \*\_\_left, \_RopeRep \*\_\_right)\
 static \_RopeRep \* **\_S\_concat\_char\_iter** (\_RopeRep \*\_\_r, const \_CharT \*\_\_iter, size\_type \_\_slen, allocator\_type &\_\_a)\
 static \_RopeRep \* **\_S\_destr\_concat\_char\_iter** (\_RopeRep \*\_\_r, const \_CharT \*\_\_iter, size\_type \_\_slen, allocator\_type &\_\_a)\
 static \_RopeLeaf \* **\_S\_destr\_leaf\_concat\_char\_iter** (\_RopeLeaf \*\_\_r, const \_CharT \*\_\_iter, size\_type \_\_slen)\
 static \_CharT **\_S\_fetch** (\_RopeRep \*\_\_r, size\_type \_\_pos)\
 static \_CharT \* **\_S\_fetch\_ptr** (\_RopeRep \*\_\_r, size\_type \_\_pos)\
 static bool **\_S\_is0** (\_CharT \_\_c)\
 static \_RopeLeaf \* **\_S\_leaf\_concat\_char\_iter** (\_RopeLeaf \*\_\_r, const \_CharT \*\_\_iter, size\_type \_\_slen)\
 static \_RopeConcatenation \* **\_S\_new\_RopeConcatenation** (\_RopeRep \*\_\_left, \_RopeRep \*\_\_right, allocator\_type &\_\_a)\
 static \_RopeFunction \* **\_S\_new\_RopeFunction** (char\_producer\< \_CharT \> \*\_\_f, size\_type \_\_size, bool \_\_d, allocator\_type &\_\_a)\
 static \_RopeLeaf \* **\_S\_new\_RopeLeaf** (\_CharT \*\_\_s, size\_type \_\_size, allocator\_type &\_\_a)\
 static \_RopeSubstring \* **\_S\_new\_RopeSubstring** (\_Rope\_RopeRep\< \_CharT, \_Alloc \> \*\_\_b, size\_type \_\_s, size\_type \_\_l, allocator\_type &\_\_a)\
 static void **\_S\_ref** (\_RopeRep \*\_\_t)\
 static \_RopeLeaf \* **\_S\_RopeLeaf\_from\_unowned\_char\_ptr** (const \_CharT \*\_\_s, size\_type \_\_size, allocator\_type &\_\_a)\
 static size\_type **\_S\_rounded\_up\_size** (size\_type \_\_n)\
 static \_RopeRep \* **\_S\_substring** (\_RopeRep \*\_\_base, size\_type \_\_start, size\_type \_\_endp1)\
 static \_RopeRep \* **\_S\_tree\_concat** (\_RopeRep \*\_\_left, \_RopeRep \*\_\_right)\
 static void **\_S\_unref** (\_RopeRep \*\_\_t)\
 static \_RopeRep \* **replace** (\_RopeRep \*\_\_old, size\_type \_\_pos1, size\_type \_\_pos2, \_RopeRep \*\_\_r)\

### Static Protected Attributes

static \_CharT **\_S\_empty\_c\_str** \[1\]\

### Friends

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

### template\<class \_CharT, class \_Alloc\>

class \_\_gnu\_cxx::rope\< \_CharT, \_Alloc \>"This is an SGI extension.

**Todo**

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

## Author

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