---
name: "__gnu_cxx::__versa_string"
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::__versa_string"
---

# \_\_gnu\_cxx::\_\_versa\_string(3)

Template class \_\_versa\_string.

## NAME

\_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> - Template class \_\_versa\_string.

## SYNOPSIS

\#include \<vstring.h\>

### Public Types

typedef \_Alloc **allocator\_type**\
 typedef \_\_gnu\_cxx::\_\_normal\_iterator\< const\_pointer, **\_\_versa\_string** \> **const\_iterator**\
 typedef \_CharT\_alloc\_traits::const\_pointer **const\_pointer**\
 typedef const value\_type & **const\_reference**\
 typedef **std::reverse\_iterator**\< const\_iterator \> **const\_reverse\_iterator**\
 typedef \_CharT\_alloc\_type::difference\_type **difference\_type**\
 typedef \_\_gnu\_cxx::\_\_normal\_iterator\< pointer, **\_\_versa\_string** \> **iterator**\
 typedef \_CharT\_alloc\_traits::pointer **pointer**\
 typedef value\_type & **reference**\
 typedef **std::reverse\_iterator**\< iterator \> **reverse\_iterator**\
 typedef \_CharT\_alloc\_type::size\_type **size\_type**\
 typedef \_Traits **traits\_type**\
 typedef \_Traits::char\_type **value\_type**\

### Public Member Functions

**\_\_versa\_string** (\_\_versa\_string &&\_\_str) noexcept\
 String move constructor.  template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> **\_\_versa\_string** (\_InputIterator \_\_beg, \_InputIterator \_\_end, const \_Alloc &\_\_a=\_Alloc())\
 Construct string as copy of a range.  **\_\_versa\_string** (const \_\_versa\_string &\_\_str)\
 Construct string with copy of value of *\_\_str*.  **\_\_versa\_string** (const \_\_versa\_string &\_\_str, size\_type \_\_pos, size\_type \_\_n, const \_Alloc &\_\_a)\
 Construct string as copy of a substring.  **\_\_versa\_string** (const \_\_versa\_string &\_\_str, size\_type \_\_pos, size\_type \_\_n=**npos**)\
 Construct string as copy of a substring.  **\_\_versa\_string** (const \_Alloc &\_\_a=\_Alloc()) noexcept\
 Construct an empty string using allocator *a*.  **\_\_versa\_string** (const \_CharT \*\_\_s, const \_Alloc &\_\_a=\_Alloc())\
 Construct string as copy of a C string.  **\_\_versa\_string** (const \_CharT \*\_\_s, size\_type \_\_n, const \_Alloc &\_\_a=\_Alloc())\
 Construct string initialized by a character array.  **\_\_versa\_string** (size\_type \_\_n, \_CharT \_\_c, const \_Alloc &\_\_a=\_Alloc())\
 Construct string as multiple characters.  **\_\_versa\_string** (**std::initializer\_list**\< \_CharT \> \_\_l, const \_Alloc &\_\_a=\_Alloc())\
 Construct string from an initializer list.  **~\_\_versa\_string** () noexcept\
 Destroy the string instance.  template\<typename \_InputIterator\> **\_\_versa\_string**\< \_CharT, \_Traits, \_Alloc, \_Base \> & **\_M\_replace\_dispatch** (const\_iterator \_\_i1, const\_iterator \_\_i2, \_InputIterator \_\_k1, \_InputIterator \_\_k2, std::\_\_false\_type)\
 template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> **\_\_versa\_string** & **append** (\_InputIterator \_\_first, \_InputIterator \_\_last)\
 Append a range of characters.  **\_\_versa\_string** & **append** (const **\_\_versa\_string** &\_\_str)\
 Append a string to this string.  **\_\_versa\_string** & **append** (const **\_\_versa\_string** &\_\_str, size\_type \_\_pos, size\_type \_\_n)\
 Append a substring.  **\_\_versa\_string** & **append** (const \_CharT \*\_\_s)\
 Append a C string.  **\_\_versa\_string** & **append** (const \_CharT \*\_\_s, size\_type \_\_n)\
 Append a C substring.  **\_\_versa\_string** & **append** (size\_type \_\_n, \_CharT \_\_c)\
 Append multiple characters.  **\_\_versa\_string** & **append** (**std::initializer\_list**\< \_CharT \> \_\_l)\
 Append an initializer\_list of characters.  **\_\_versa\_string** & **assign** (**\_\_versa\_string** &&\_\_str) noexcept\
 Set value to contents of another string.  template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> **\_\_versa\_string** & **assign** (\_InputIterator \_\_first, \_InputIterator \_\_last)\
 Set value to a range of characters.  **\_\_versa\_string** & **assign** (const **\_\_versa\_string** &\_\_str)\
 Set value to contents of another string.  **\_\_versa\_string** & **assign** (const **\_\_versa\_string** &\_\_str, size\_type \_\_pos, size\_type \_\_n)\
 Set value to a substring of a string.  **\_\_versa\_string** & **assign** (const \_CharT \*\_\_s)\
 Set value to contents of a C string.  **\_\_versa\_string** & **assign** (const \_CharT \*\_\_s, size\_type \_\_n)\
 Set value to a C substring.  **\_\_versa\_string** & **assign** (size\_type \_\_n, \_CharT \_\_c)\
 Set value to multiple characters.  **\_\_versa\_string** & **assign** (**std::initializer\_list**\< \_CharT \> \_\_l)\
 Set value to an initializer\_list of characters.  reference **at** (size\_type \_\_n)\
 Provides access to the data contained in the string.  const\_reference **at** (size\_type \_\_n) const\
 Provides access to the data contained in the string.  const\_reference **back** () const noexcept\
 reference **back** () noexcept\
 const\_iterator **begin** () const noexcept\
 iterator **begin** () noexcept\
 const \_CharT \* **c\_str** () const noexcept\
 Return const pointer to null-terminated contents.  size\_type **capacity** () const noexcept\
 const\_iterator **cbegin** () const noexcept\
 const\_iterator **cend** () const noexcept\
 void **clear** () noexcept\
 int **compare** (const **\_\_versa\_string** &\_\_str) const\
 Compare to a string.  int **compare** (const \_CharT \*\_\_s) const\
 Compare to a C string.  int **compare** (size\_type \_\_pos, size\_type \_\_n, const **\_\_versa\_string** &\_\_str) const\
 Compare substring to a string.  int **compare** (size\_type \_\_pos, size\_type \_\_n1, const \_CharT \*\_\_s) const\
 Compare substring to a C string.  int **compare** (size\_type \_\_pos, size\_type \_\_n1, const \_CharT \*\_\_s, size\_type \_\_n2) const\
 Compare substring against a character array.  int **compare** (size\_type \_\_pos1, size\_type \_\_n1, const **\_\_versa\_string** &\_\_str, size\_type \_\_pos2, size\_type \_\_n2) const\
 Compare substring to a substring.  size\_type **copy** (\_CharT \*\_\_s, size\_type \_\_n, size\_type \_\_pos=0) const\
 Copy substring into C string.  const\_reverse\_iterator **crbegin** () const noexcept\
 const\_reverse\_iterator **crend** () const noexcept\
 const \_CharT \* **data** () const noexcept\
 Return const pointer to contents.  bool **empty** () const noexcept\
 const\_iterator **end** () const noexcept\
 iterator **end** () noexcept\
 iterator **erase** (const\_iterator \_\_first, const\_iterator \_\_last)\
 Remove a range of characters.  iterator **erase** (const\_iterator \_\_position)\
 Remove one character.  **\_\_versa\_string** & **erase** (size\_type \_\_pos=0, size\_type \_\_n=**npos**)\
 Remove characters.  size\_type **find** (\_CharT \_\_c, size\_type \_\_pos=0) const noexcept\
 Find position of a character.  size\_type **find** (const **\_\_versa\_string** &\_\_str, size\_type \_\_pos=0) const noexcept\
 Find position of a string.  size\_type **find** (const \_CharT \*\_\_s, size\_type \_\_pos, size\_type \_\_n) const\
 Find position of a C substring.  size\_type **find** (const \_CharT \*\_\_s, size\_type \_\_pos=0) const\
 Find position of a C string.  size\_type **find\_first\_not\_of** (\_CharT \_\_c, size\_type \_\_pos=0) const noexcept\
 Find position of a different character.  size\_type **find\_first\_not\_of** (const **\_\_versa\_string** &\_\_str, size\_type \_\_pos=0) const noexcept\
 Find position of a character not in string.  size\_type **find\_first\_not\_of** (const \_CharT \*\_\_s, size\_type \_\_pos, size\_type \_\_n) const\
 Find position of a character not in C substring.  size\_type **find\_first\_not\_of** (const \_CharT \*\_\_s, size\_type \_\_pos=0) const\
 Find position of a character not in C string.  size\_type **find\_first\_of** (\_CharT \_\_c, size\_type \_\_pos=0) const noexcept\
 Find position of a character.  size\_type **find\_first\_of** (const **\_\_versa\_string** &\_\_str, size\_type \_\_pos=0) const noexcept\
 Find position of a character of string.  size\_type **find\_first\_of** (const \_CharT \*\_\_s, size\_type \_\_pos, size\_type \_\_n) const\
 Find position of a character of C substring.  size\_type **find\_first\_of** (const \_CharT \*\_\_s, size\_type \_\_pos=0) const\
 Find position of a character of C string.  size\_type **find\_last\_not\_of** (\_CharT \_\_c, size\_type \_\_pos=**npos**) const noexcept\
 Find last position of a different character.  size\_type **find\_last\_not\_of** (const **\_\_versa\_string** &\_\_str, size\_type \_\_pos=**npos**) const noexcept\
 Find last position of a character not in string.  size\_type **find\_last\_not\_of** (const \_CharT \*\_\_s, size\_type \_\_pos, size\_type \_\_n) const\
 Find last position of a character not in C substring.  size\_type **find\_last\_not\_of** (const \_CharT \*\_\_s, size\_type \_\_pos=**npos**) const\
 Find last position of a character not in C string.  size\_type **find\_last\_of** (\_CharT \_\_c, size\_type \_\_pos=**npos**) const noexcept\
 Find last position of a character.  size\_type **find\_last\_of** (const **\_\_versa\_string** &\_\_str, size\_type \_\_pos=**npos**) const noexcept\
 Find last position of a character of string.  size\_type **find\_last\_of** (const \_CharT \*\_\_s, size\_type \_\_pos, size\_type \_\_n) const\
 Find last position of a character of C substring.  size\_type **find\_last\_of** (const \_CharT \*\_\_s, size\_type \_\_pos=**npos**) const\
 Find last position of a character of C string.  const\_reference **front** () const noexcept\
 reference **front** () noexcept\
 allocator\_type **get\_allocator** () const noexcept\
 Return copy of allocator used to construct this string.  iterator **insert** (const\_iterator \_\_p, \_CharT \_\_c)\
 Insert one character.  template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> iterator **insert** (const\_iterator \_\_p, \_InputIterator \_\_beg, \_InputIterator \_\_end)\
 Insert a range of characters.  iterator **insert** (const\_iterator \_\_p, size\_type \_\_n, \_CharT \_\_c)\
 Insert multiple characters.  iterator **insert** (const\_iterator \_\_p, **std::initializer\_list**\< \_CharT \> \_\_l)\
 Insert an initializer\_list of characters.  **\_\_versa\_string** & **insert** (size\_type \_\_pos, const \_CharT \*\_\_s)\
 Insert a C string.  **\_\_versa\_string** & **insert** (size\_type \_\_pos, const \_CharT \*\_\_s, size\_type \_\_n)\
 Insert a C substring.  **\_\_versa\_string** & **insert** (size\_type \_\_pos, size\_type \_\_n, \_CharT \_\_c)\
 Insert multiple characters.  **\_\_versa\_string** & **insert** (size\_type \_\_pos1, const **\_\_versa\_string** &\_\_str)\
 Insert value of a string.  **\_\_versa\_string** & **insert** (size\_type \_\_pos1, const **\_\_versa\_string** &\_\_str, size\_type \_\_pos2, size\_type \_\_n)\
 Insert a substring.  size\_type **length** () const noexcept\
 Returns the number of characters in the string, not including any null-termination.  size\_type **max\_size** () const noexcept\
 Returns the size() of the largest possible string.  **\_\_versa\_string** & **operator+=** (\_CharT \_\_c)\
 Append a character.  **\_\_versa\_string** & **operator+=** (const **\_\_versa\_string** &\_\_str)\
 Append a string to this string.  **\_\_versa\_string** & **operator+=** (const \_CharT \*\_\_s)\
 Append a C string.  **\_\_versa\_string** & **operator+=** (**std::initializer\_list**\< \_CharT \> \_\_l)\
 Append an initializer\_list of characters.  **\_\_versa\_string** & **operator=** (**\_\_versa\_string** &&\_\_str) noexcept\
 String move assignment operator.  **\_\_versa\_string** & **operator=** (\_CharT \_\_c)\
 Set value to string of length 1.  **\_\_versa\_string** & **operator=** (const **\_\_versa\_string** &\_\_str)\
 Assign the value of *str* to this string.  **\_\_versa\_string** & **operator=** (const \_CharT \*\_\_s)\
 Copy contents of *\_\_s* into this string.  **\_\_versa\_string** & **operator=** (**std::initializer\_list**\< \_CharT \> \_\_l)\
 Set value to string constructed from initializer list.  const\_reference **operator\[\]** (size\_type \_\_pos) const noexcept\
 Subscript access to the data contained in the string.  reference **operator\[\]** (size\_type \_\_pos) noexcept\
 Subscript access to the data contained in the string.  void **pop\_back** ()\
 Remove the last character.  void **push\_back** (\_CharT \_\_c)\
 Append a single character.  const\_reverse\_iterator **rbegin** () const noexcept\
 reverse\_iterator **rbegin** () noexcept\
 const\_reverse\_iterator **rend** () const noexcept\
 reverse\_iterator **rend** () noexcept\
 **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, \_CharT \*\_\_k1, \_CharT \*\_\_k2)\
 template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, \_InputIterator \_\_k1, \_InputIterator \_\_k2)\
 Replace range of characters with range.  **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, const **\_\_versa\_string** &\_\_str)\
 Replace range of characters with string.  **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, const \_CharT \*\_\_k1, const \_CharT \*\_\_k2)\
 **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, const \_CharT \*\_\_s)\
 Replace range of characters with C string.  **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, const \_CharT \*\_\_s, size\_type \_\_n)\
 Replace range of characters with C substring.  **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, const\_iterator \_\_k1, const\_iterator \_\_k2)\
 **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, iterator \_\_k1, iterator \_\_k2)\
 **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, size\_type \_\_n, \_CharT \_\_c)\
 Replace range of characters with multiple characters.  **\_\_versa\_string** & **replace** (const\_iterator \_\_i1, const\_iterator \_\_i2, **std::initializer\_list**\< \_CharT \> \_\_l)\
 Replace range of characters with initializer\_list.  **\_\_versa\_string** & **replace** (size\_type \_\_pos, size\_type \_\_n, const **\_\_versa\_string** &\_\_str)\
 Replace characters with value from another string.  **\_\_versa\_string** & **replace** (size\_type \_\_pos, size\_type \_\_n1, const \_CharT \*\_\_s)\
 Replace characters with value of a C string.  **\_\_versa\_string** & **replace** (size\_type \_\_pos, size\_type \_\_n1, const \_CharT \*\_\_s, size\_type \_\_n2)\
 Replace characters with value of a C substring.  **\_\_versa\_string** & **replace** (size\_type \_\_pos, size\_type \_\_n1, size\_type \_\_n2, \_CharT \_\_c)\
 Replace characters with multiple characters.  **\_\_versa\_string** & **replace** (size\_type \_\_pos1, size\_type \_\_n1, const **\_\_versa\_string** &\_\_str, size\_type \_\_pos2, size\_type \_\_n2)\
 Replace characters with value from another string.  void **reserve** (size\_type \_\_res\_arg=0)\
 Attempt to preallocate enough memory for specified number of characters.  void **resize** (size\_type \_\_n)\
 Resizes the string to the specified number of characters.  void **resize** (size\_type \_\_n, \_CharT \_\_c)\
 Resizes the string to the specified number of characters.  size\_type **rfind** (\_CharT \_\_c, size\_type \_\_pos=**npos**) const noexcept\
 Find last position of a character.  size\_type **rfind** (const **\_\_versa\_string** &\_\_str, size\_type \_\_pos=**npos**) const noexcept\
 Find last position of a string.  size\_type **rfind** (const \_CharT \*\_\_s, size\_type \_\_pos, size\_type \_\_n) const\
 Find last position of a C substring.  size\_type **rfind** (const \_CharT \*\_\_s, size\_type \_\_pos=**npos**) const\
 Find last position of a C string.  void **shrink\_to\_fit** () noexcept\
 A non-binding request to reduce capacity() to size().  size\_type **size** () const noexcept\
 Returns the number of characters in the string, not including any null-termination.  **\_\_versa\_string** **substr** (size\_type \_\_pos=0, size\_type \_\_n=**npos**) const\
 Get a substring.  void **swap** (**\_\_versa\_string** &\_\_s) noexcept\
 Swap contents with another string.

### Static Public Attributes

static const size\_type **npos**\
 Value returned by various member functions when they fail.

## Detailed Description

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\>

class \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>"Template class \_\_versa\_string.

Data structure managing sequences of characters and character-like objects.

## Constructor & Destructor Documentation

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (const \_Alloc & \_\_a = \_Alloc()) \[inline\], \[explicit\], \[noexcept\]

Construct an empty string using allocator *a*.

Referenced by **compare()**, **compare()**, and **\_\_gnu\_cxx::\_\_versa\_string\< char \>::substr()**.

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) \[inline\]

Construct string with copy of value of *\_\_str*.

**Parameters**

*\_\_str* Source string.

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> && \_\_str) \[inline\], \[noexcept\]

String move constructor.

**Parameters**

*\_\_str* Source string.

The newly-constructed string contains the exact contents of *\_\_str*. The contents of *\_\_str* are a valid, but unspecified string.

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (std::initializer\_list\< \_CharT \> \_\_l, const \_Alloc & \_\_a = \_Alloc()) \[inline\]

Construct string from an initializer list.

**Parameters**

*\_\_l* std::initializer\_list of characters. \
 *\_\_a* Allocator to use (default is default allocator).

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos, size\_type \_\_n = npos) \[inline\]

Construct string as copy of a substring.

**Parameters**

*\_\_str* Source string. \
 *\_\_pos* Index of first character to copy from. \
 *\_\_n* Number of characters to copy (default remainder).

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos, size\_type \_\_n, const \_Alloc & \_\_a) \[inline\]

Construct string as copy of a substring.

**Parameters**

*\_\_str* Source string. \
 *\_\_pos* Index of first character to copy from. \
 *\_\_n* Number of characters to copy. \
 *\_\_a* Allocator to use.

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (const \_CharT \* \_\_s, size\_type \_\_n, const \_Alloc & \_\_a = \_Alloc()) \[inline\]

Construct string initialized by a character array.

**Parameters**

*\_\_s* Source character array. \
 *\_\_n* Number of characters to copy. \
 *\_\_a* Allocator to use (default is default allocator).

NB: *\_\_s* must have at least *\_\_n* characters, '\\0' has no special meaning.

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (const \_CharT \* \_\_s, const \_Alloc & \_\_a = \_Alloc()) \[inline\]

Construct string as copy of a C string.

**Parameters**

*\_\_s* Source C string. \
 *\_\_a* Allocator to use (default is default allocator).

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (size\_type \_\_n, \_CharT \_\_c, const \_Alloc & \_\_a = \_Alloc()) \[inline\]

Construct string as multiple characters.

**Parameters**

*\_\_n* Number of characters. \
 *\_\_c* Character to use. \
 *\_\_a* Allocator to use (default is default allocator).

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::\_\_versa\_string (\_InputIterator \_\_beg, \_InputIterator \_\_end, const \_Alloc & \_\_a = \_Alloc()) \[inline\]

Construct string as copy of a range.

**Parameters**

*\_\_beg* Start of range. \
 *\_\_end* End of range. \
 *\_\_a* Allocator to use (default is default allocator).

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::~\_\_versa\_string () \[inline\], \[noexcept\]

Destroy the string instance.

## Member Function Documentation

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::append (\_InputIterator \_\_first, \_InputIterator \_\_last) \[inline\]

Append a range of characters.

**Parameters**

*\_\_first* Iterator referencing the first character to append. \
 *\_\_last* Iterator marking the end of the range.

**Returns**

Reference to this string.

Appends characters in the range \[first,last) to this string.

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::append (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) \[inline\]

Append a string to this string.

**Parameters**

*\_\_str* The string to append.

**Returns**

Reference to this string.

Referenced by **\_\_gnu\_cxx::\_\_versa\_string\< char \>::append()**, **std::getline()**, **\_\_gnu\_cxx::operator+()**, **\_\_gnu\_cxx::operator+()**, **\_\_gnu\_cxx::operator+()**, **\_\_gnu\_cxx::\_\_versa\_string\< char \>::operator+=()**, **\_\_gnu\_cxx::\_\_versa\_string\< char \>::operator+=()**, **\_\_gnu\_cxx::\_\_versa\_string\< char \>::operator+=()**, and **resize()**.

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::append (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos, size\_type \_\_n) \[inline\]

Append a substring.

**Parameters**

*\_\_str* The string to append. \
 *\_\_pos* Index of the first character of str to append. \
 *\_\_n* The number of characters to append.

**Returns**

Reference to this string.

**Exceptions**

**std::out\_of\_range if** *pos* **is not a valid index.**

**This function appends** *\_\_n* **characters from** *\_\_str* **starting at** *\_\_pos* **to this string. If** *\_\_n* **is is larger than the number of available characters in** *\_\_str***, the remainder of** *\_\_str* **is appended.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::append (const \_CharT \* \_\_s) \[inline\]

**Append a C string.**

**Parameters**

*\_\_s* **The C string to append.**

**Returns**

**Reference to this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::append (const \_CharT \* \_\_s, size\_type \_\_n) \[inline\]

**Append a C substring.**

**Parameters**

*\_\_s* **The C string to append.** \
 *\_\_n* **The number of characters to append.**

**Returns**

**Reference to this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::append (size\_type \_\_n, \_CharT \_\_c) \[inline\]

**Append multiple characters.**

**Parameters**

*\_\_n* **The number of characters to append.** \
 *\_\_c* **The character to use.**

**Returns**

**Reference to this string.**

**Appends n copies of c to this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::append (std::initializer\_list\< \_CharT \> \_\_l) \[inline\]

**Append an initializer\_list of characters.**

**Parameters**

*\_\_l* **The initializer\_list of characters to append.**

**Returns**

**Reference to this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::assign (\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> && \_\_str) \[inline\], \[noexcept\]

**Set value to contents of another string.**

**Parameters**

*\_\_str* **Source string to use.**

**Returns**

**Reference to this string.**

**This function sets this string to the exact contents of** *\_\_str***.** *\_\_str* **is a valid, but unspecified string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::assign (\_InputIterator \_\_first, \_InputIterator \_\_last) \[inline\]

**Set value to a range of characters.**

**Parameters**

*\_\_first* **Iterator referencing the first character to append.** \
 *\_\_last* **Iterator marking the end of the range.**

**Returns**

**Reference to this string.**

**Sets value of string to characters in the range \[first,last).**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::assign (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) \[inline\]

**Set value to contents of another string.**

**Parameters**

*\_\_str* **Source string to use.**

**Returns**

**Reference to this string.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::assign(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::operator=(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::operator=(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::operator=(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::operator=().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::assign (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos, size\_type \_\_n) \[inline\]

**Set value to a substring of a string.**

**Parameters**

*\_\_str* **The string to use.** \
 *\_\_pos* **Index of the first character of str.** \
 *\_\_n* **Number of characters to use.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::out\_of\_range if** *\_\_pos* **is not a valid index.**

**This function sets this string to the substring of** *\_\_str* **consisting of** *\_\_n* **characters at** *\_\_pos***. If** *\_\_n* **is is larger than the number of available characters in** *\_\_str***, the remainder of** *\_\_str* **is used.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::assign (const \_CharT \* \_\_s) \[inline\]

**Set value to contents of a C string.**

**Parameters**

*\_\_s* **The C string to use.**

**Returns**

**Reference to this string.**

**This function sets the value of this string to the value of** *\_\_s***. The data is copied, so there is no dependence on** *\_\_s* **once the function returns.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::assign (const \_CharT \* \_\_s, size\_type \_\_n) \[inline\]

**Set value to a C substring.**

**Parameters**

*\_\_s* **The C string to use.** \
 *\_\_n* **Number of characters to use.**

**Returns**

**Reference to this string.**

**This function sets the value of this string to the first** *\_\_n* **characters of** *\_\_s***. If** *\_\_n* **is is larger than the number of available characters in** *\_\_s***, the remainder of** *\_\_s* **is used.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::assign (size\_type \_\_n, \_CharT \_\_c) \[inline\]

**Set value to multiple characters.**

**Parameters**

*\_\_n* **Length of the resulting string.** \
 *\_\_c* **The character to use.**

**Returns**

**Reference to this string.**

**This function sets the value of this string to** *\_\_n* **copies of character** *\_\_c***.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::assign (std::initializer\_list\< \_CharT \> \_\_l) \[inline\]

**Set value to an initializer\_list of characters.**

**Parameters**

*\_\_l* **The initializer\_list of characters to assign.**

**Returns**

**Reference to this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> reference \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::at (size\_type \_\_n) \[inline\]

**Provides access to the data contained in the string.**

**Parameters**

*\_\_n* **The index of the character to access.**

**Returns**

**Read/write reference to the character.**

**Exceptions**

**std::out\_of\_range If** *\_\_n* **is an invalid index.**

**This function provides for safer data access. The parameter is first checked that it is in the range of the string. The function throws out\_of\_range if the check fails. Success results in unsharing the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_reference \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::at (size\_type \_\_n) const \[inline\]

**Provides access to the data contained in the string.**

**Parameters**

*\_\_n* **The index of the character to access.**

**Returns**

**Read-only (const) reference to the character.**

**Exceptions**

**std::out\_of\_range If** *\_\_n* **is an invalid index.**

**This function provides for safer data access. The parameter is first checked that it is in the range of the string. The function throws out\_of\_range if the check fails.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_reference \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::back () const \[inline\], \[noexcept\]

**Returns a read-only (constant) reference to the data at the last element of the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> reference \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::back () \[inline\], \[noexcept\]

**Returns a read/write reference to the data at the last element of the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::begin () const \[inline\], \[noexcept\]

**Returns a read-only (constant) iterator that points to the first character in the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::begin () \[inline\], \[noexcept\]

**Returns a read/write iterator that points to the first character in the string. Unshares the string.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::crend(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::rend(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::rend().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const \_CharT \* \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::c\_str () const \[inline\], \[noexcept\]

**Return const pointer to null-terminated contents. This is a handle to internal data. Do not modify or dire things may happen.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::capacity () const \[inline\], \[noexcept\]

**Returns the total number of characters that the string can hold before needing to allocate more memory.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::push\_back(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::shrink\_to\_fit().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::cbegin () const \[inline\], \[noexcept\]

**Returns a read-only (constant) iterator that points to the first character in the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::cend () const \[inline\], \[noexcept\]

**Returns a read-only (constant) iterator that points one past the last character in the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> void \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::clear () \[inline\], \[noexcept\]

**Erases the string, making it empty.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> int \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::compare (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) const \[inline\]

**Compare to a string.**

**Parameters**

*\_\_str* **String to compare against.**

**Returns**

**Integer \< 0, 0, or \> 0.**

**Returns an integer \< 0 if this string is ordered before** *\_\_str***, 0 if their values are equivalent, or \> 0 if this string is ordered after** *\_\_str***. Determines the effective length rlen of the strings to compare as the smallest of size() and str.size(). The function then compares the two strings by calling traits::compare(data(), str.data(),rlen). If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first.**

**Referenced by \_\_gnu\_cxx::operator\<(), \_\_gnu\_cxx::operator\<(), \_\_gnu\_cxx::operator\<(), \_\_gnu\_cxx::operator\<=(), \_\_gnu\_cxx::operator\<=(), \_\_gnu\_cxx::operator\<=(), \_\_gnu\_cxx::operator\>(), \_\_gnu\_cxx::operator\>(), \_\_gnu\_cxx::operator\>(), \_\_gnu\_cxx::operator\>=(), \_\_gnu\_cxx::operator\>=(), and \_\_gnu\_cxx::operator\>=().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> int \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::compare (const \_CharT \* \_\_s) const

**Compare to a C string.**

**Parameters**

*\_\_s* **C string to compare against.**

**Returns**

**Integer \< 0, 0, or \> 0.**

**Returns an integer \< 0 if this string is ordered before** *\_\_s***, 0 if their values are equivalent, or \> 0 if this string is ordered after** *\_\_s***. Determines the effective length rlen of the strings to compare as the smallest of size() and the length of a string constructed from** *\_\_s***. The function then compares the two strings by calling traits::compare(data(),s,rlen). If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first.**

**References std::min(), and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> int \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::compare (size\_type \_\_pos, size\_type \_\_n, const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) const

**Compare substring to a string.**

**Parameters**

*\_\_pos* **Index of first character of substring.** \
 *\_\_n* **Number of characters in substring.** \
 *\_\_str* **String to compare against.**

**Returns**

**Integer \< 0, 0, or \> 0.**

**Form the substring of this string from the** *\_\_n* **characters starting at** *\_\_pos***. Returns an integer \< 0 if the substring is ordered before** *\_\_str***, 0 if their values are equivalent, or \> 0 if the substring is ordered after** *\_\_str***. Determines the effective length rlen of the strings to compare as the smallest of the length of the substring and** *\_\_str.size()***. The function then compares the two strings by calling traits::compare(substring.data(),str.data(),rlen). If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first.**

**References \_\_versa\_string(), data(), std::min(), and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> int \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::compare (size\_type \_\_pos, size\_type \_\_n1, const \_CharT \* \_\_s) const

**Compare substring to a C string.**

**Parameters**

*\_\_pos* **Index of first character of substring.** \
 *\_\_n1* **Number of characters in substring.** \
 *\_\_s* **C string to compare against.**

**Returns**

**Integer \< 0, 0, or \> 0.**

**Form the substring of this string from the** *\_\_n1* **characters starting at** *\_\_pos***. Returns an integer \< 0 if the substring is ordered before** *\_\_s***, 0 if their values are equivalent, or \> 0 if the substring is ordered after** *\_\_s***. Determines the effective length rlen of the strings to compare as the smallest of the length of the substring and the length of a string constructed from** *\_\_s***. The function then compares the two string by calling traits::compare(substring.data(),s,rlen). If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first.**

**References std::min().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> int \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::compare (size\_type \_\_pos, size\_type \_\_n1, const \_CharT \* \_\_s, size\_type \_\_n2) const

**Compare substring against a character array.**

**Parameters**

*\_\_pos* **Index of first character of substring.** \
 *\_\_n1* **Number of characters in substring.** \
 *\_\_s* **character array to compare against.** \
 *\_\_n2* **Number of characters of s.**

**Returns**

**Integer \< 0, 0, or \> 0.**

**Form the substring of this string from the** *\_\_n1* **characters starting at** *\_\_pos***. Form a string from the first** *\_\_n2* **characters of** *\_\_s***. Returns an integer \< 0 if this substring is ordered before the string from** *\_\_s***, 0 if their values are equivalent, or \> 0 if this substring is ordered after the string from** *\_\_s***. Determines the effective length rlen of the strings to compare as the smallest of the length of the substring and** *\_\_n2***. The function then compares the two strings by calling traits::compare(substring.data(),\_\_s,rlen). If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first.**

**NB: \_\_s must have at least n2 characters,** *\\0* **has no special meaning.**

**References std::min().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> int \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::compare (size\_type \_\_pos1, size\_type \_\_n1, const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos2, size\_type \_\_n2) const

**Compare substring to a substring.**

**Parameters**

*\_\_pos1* **Index of first character of substring.** \
 *\_\_n1* **Number of characters in substring.** \
 *\_\_str* **String to compare against.** \
 *\_\_pos2* **Index of first character of substring of str.** \
 *\_\_n2* **Number of characters in substring of str.**

**Returns**

**Integer \< 0, 0, or \> 0.**

**Form the substring of this string from the** *\_\_n1* **characters starting at** *\_\_pos1***. Form the substring of** *\_\_str* **from the** *\_\_n2* **characters starting at** *\_\_pos2***. Returns an integer \< 0 if this substring is ordered before the substring of** *\_\_str***, 0 if their values are equivalent, or \> 0 if this substring is ordered after the substring of** *\_\_str***. Determines the effective length rlen of the strings to compare as the smallest of the lengths of the substrings. The function then compares the two strings by calling traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen). If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first.**

**References \_\_versa\_string(), data(), and std::min().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::copy (\_CharT \* \_\_s, size\_type \_\_n, size\_type \_\_pos = 0) const

**Copy substring into C string.**

**Parameters**

*\_\_s* **C string to copy value into.** \
 *\_\_n* **Number of characters to copy.** \
 *\_\_pos* **Index of first character to copy.**

**Returns**

**Number of characters actually copied**

**Exceptions**

**std::out\_of\_range If pos \> size().**

**Copies up to** *\_\_n* **characters starting at** *\_\_pos* **into the C string** *s***. If** *\_\_pos* **is greater than size(), out\_of\_range is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_reverse\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::crbegin () const \[inline\], \[noexcept\]

**Returns a read-only (constant) reverse iterator that points to the last character in the string. Iteration is done in reverse element order.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_reverse\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::crend () const \[inline\], \[noexcept\]

**Returns a read-only (constant) reverse iterator that points to one before the first character in the string. Iteration is done in reverse element order.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const \_CharT \* \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::data () const \[inline\], \[noexcept\]

**Return const pointer to contents. This is a handle to internal data. Do not modify or dire things may happen.**

**Referenced by compare(), compare(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::compare(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::find(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_first\_not\_of(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_first\_of(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_last\_of(), \_\_gnu\_cxx::operator==(), and \_\_gnu\_cxx::operator==().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> bool \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::empty () const \[inline\], \[nodiscard\], \[noexcept\]

**Returns true if the string is empty. Equivalent to** \*this == ""**.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::end () const \[inline\], \[noexcept\]

**Returns a read-only (constant) iterator that points one past the last character in the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::end () \[inline\], \[noexcept\]

**Returns a read/write iterator that points one past the last character in the string. Unshares the string.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::crbegin(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::rbegin(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::rbegin().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::erase (const\_iterator \_\_first, const\_iterator \_\_last) \[inline\]

**Remove a range of characters.**

**Parameters**

*\_\_first* **Iterator referencing the first character to remove.** \
 *\_\_last* **Iterator referencing the end of the range.**

**Returns**

**Iterator referencing location of first after removal.**

**Removes the characters in the range \[first,last) from this string. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::erase (const\_iterator \_\_position) \[inline\]

**Remove one character.**

**Parameters**

*\_\_position* **Iterator referencing the character to remove.**

**Returns**

**iterator referencing same location after removal.**

**Removes the character at** *\_\_position* **from this string. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::erase (size\_type \_\_pos = 0, size\_type \_\_n = npos) \[inline\]

**Remove characters.**

**Parameters**

*\_\_pos* **Index of first character to remove (default 0).** \
 *\_\_n* **Number of characters to remove (default remainder).**

**Returns**

**Reference to this string.**

**Exceptions**

**std::out\_of\_range If** *\_\_pos* **is beyond the end of this string.**

**Removes** *\_\_n* **characters from this string starting at** *\_\_pos***. The length of the string is reduced by** *\_\_n***. If there are \<** *\_\_n* **characters to remove, the remainder of the string is truncated. If** *\_\_p* **is beyond end of string, out\_of\_range is thrown. The value of the string doesn't change if an error is thrown.**

**Referenced by std::getline().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find (\_CharT \_\_c, size\_type \_\_pos = 0) const \[noexcept\]

**Find position of a character.**

**Parameters**

*\_\_c* **Character to locate.** \
 *\_\_pos* **Index of character to search from (default 0).**

**Returns**

**Index of first occurrence.**

**Starting from** *\_\_pos***, searches forward for** *\_\_c* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**References npos, and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos = 0) const \[inline\], \[noexcept\]

**Find position of a string.**

**Parameters**

*\_\_str* **String to locate.** \
 *\_\_pos* **Index of character to search from (default 0).**

**Returns**

**Index of start of first occurrence.**

**Starting from** *\_\_pos***, searches forward for value of** *\_\_str* **within this string. If found, returns the index where it begins. If not found, returns npos.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find (const \_CharT \* \_\_s, size\_type \_\_pos, size\_type \_\_n) const

**Find position of a C substring.**

**Parameters**

*\_\_s* **C string to locate.** \
 *\_\_pos* **Index of character to search from.** \
 *\_\_n* **Number of characters from** *\_\_s* **to search for.**

**Returns**

**Index of start of first occurrence.**

**Starting from** *\_\_pos***, searches forward for the first** *\_\_n* **characters in** *\_\_s* **within this string. If found, returns the index where it begins. If not found, returns npos.**

**References npos, and size().**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::find(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::find(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_first\_of().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find (const \_CharT \* \_\_s, size\_type \_\_pos = 0) const \[inline\]

**Find position of a C string.**

**Parameters**

*\_\_s* **C string to locate.** \
 *\_\_pos* **Index of character to search from (default 0).**

**Returns**

**Index of start of first occurrence.**

**Starting from** *\_\_pos***, searches forward for the value of** *\_\_s* **within this string. If found, returns the index where it begins. If not found, returns npos.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_first\_not\_of (\_CharT \_\_c, size\_type \_\_pos = 0) const \[noexcept\]

**Find position of a different character.**

**Parameters**

*\_\_c* **Character to avoid.** \
 *\_\_pos* **Index of character to search from (default 0).**

**Returns**

**Index of first occurrence.**

**Starting from** *\_\_pos***, searches forward for a character other than** *\_\_c* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**References npos, and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_first\_not\_of (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos = 0) const \[inline\], \[noexcept\]

**Find position of a character not in string.**

**Parameters**

*\_\_str* **String containing characters to avoid.** \
 *\_\_pos* **Index of character to search from (default 0).**

**Returns**

**Index of first occurrence.**

**Starting from** *\_\_pos***, searches forward for a character not contained in** *\_\_str* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_first\_not\_of(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_first\_not\_of().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_first\_not\_of (const \_CharT \* \_\_s, size\_type \_\_pos, size\_type \_\_n) const

**Find position of a character not in C substring.**

**Parameters**

*\_\_s* **C string containing characters to avoid.** \
 *\_\_pos* **Index of character to search from.** \
 *\_\_n* **Number of characters from s to consider.**

**Returns**

**Index of first occurrence.**

**Starting from** *\_\_pos***, searches forward for a character not contained in the first** *\_\_n* **characters of** *\_\_s* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**References npos, and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_first\_not\_of (const \_CharT \* \_\_s, size\_type \_\_pos = 0) const \[inline\]

**Find position of a character not in C string.**

**Parameters**

*\_\_s* **C string containing characters to avoid.** \
 *\_\_pos* **Index of character to search from (default 0).**

**Returns**

**Index of first occurrence.**

**Starting from** *\_\_pos***, searches forward for a character not contained in** *\_\_s* **within this string. If found, returns the index where it was found. If not found, returns npos.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_first\_of (\_CharT \_\_c, size\_type \_\_pos = 0) const \[inline\], \[noexcept\]

**Find position of a character.**

**Parameters**

*\_\_c* **Character to locate.** \
 *\_\_pos* **Index of character to search from (default 0).**

**Returns**

**Index of first occurrence.**

**Starting from** *\_\_pos***, searches forward for the character** *\_\_c* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**Note: equivalent to find(c, pos).**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_first\_of (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos = 0) const \[inline\], \[noexcept\]

**Find position of a character of string.**

**Parameters**

*\_\_str* **String containing characters to locate.** \
 *\_\_pos* **Index of character to search from (default 0).**

**Returns**

**Index of first occurrence.**

**Starting from** *\_\_pos***, searches forward for one of the characters of** *\_\_str* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_first\_of(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_first\_of().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_first\_of (const \_CharT \* \_\_s, size\_type \_\_pos, size\_type \_\_n) const

**Find position of a character of C substring.**

**Parameters**

*\_\_s* **String containing characters to locate.** \
 *\_\_pos* **Index of character to search from.** \
 *\_\_n* **Number of characters from s to search for.**

**Returns**

**Index of first occurrence.**

**Starting from** *\_\_pos***, searches forward for one of the first** *\_\_n* **characters of** *\_\_s* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**References npos, and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_first\_of (const \_CharT \* \_\_s, size\_type \_\_pos = 0) const \[inline\]

**Find position of a character of C string.**

**Parameters**

*\_\_s* **String containing characters to locate.** \
 *\_\_pos* **Index of character to search from (default 0).**

**Returns**

**Index of first occurrence.**

**Starting from** *\_\_pos***, searches forward for one of the characters of** *\_\_s* **within this string. If found, returns the index where it was found. If not found, returns npos.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_last\_not\_of (\_CharT \_\_c, size\_type \_\_pos = npos) const \[noexcept\]

**Find last position of a different character.**

**Parameters**

*\_\_c* **Character to avoid.** \
 *\_\_pos* **Index of character to search back from (default end).**

**Returns**

**Index of last occurrence.**

**Starting from** *\_\_pos***, searches backward for a character other than** *\_\_c* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**References npos, and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_last\_not\_of (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos = npos) const \[inline\], \[noexcept\]

**Find last position of a character not in string.**

**Parameters**

*\_\_str* **String containing characters to avoid.** \
 *\_\_pos* **Index of character to search back from (default end).**

**Returns**

**Index of last occurrence.**

**Starting from** *\_\_pos***, searches backward for a character not contained in** *\_\_str* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_last\_not\_of(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_last\_not\_of().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_last\_not\_of (const \_CharT \* \_\_s, size\_type \_\_pos, size\_type \_\_n) const

**Find last position of a character not in C substring.**

**Parameters**

*\_\_s* **C string containing characters to avoid.** \
 *\_\_pos* **Index of character to search back from.** \
 *\_\_n* **Number of characters from s to consider.**

**Returns**

**Index of last occurrence.**

**Starting from** *\_\_pos***, searches backward for a character not contained in the first** *\_\_n* **characters of** *\_\_s* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**References npos, and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_last\_not\_of (const \_CharT \* \_\_s, size\_type \_\_pos = npos) const \[inline\]

**Find last position of a character not in C string.**

**Parameters**

*\_\_s* **C string containing characters to avoid.** \
 *\_\_pos* **Index of character to search back from (default end).**

**Returns**

**Index of last occurrence.**

**Starting from** *\_\_pos***, searches backward for a character not contained in** *\_\_s* **within this string. If found, returns the index where it was found. If not found, returns npos.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_last\_of (\_CharT \_\_c, size\_type \_\_pos = npos) const \[inline\], \[noexcept\]

**Find last position of a character.**

**Parameters**

*\_\_c* **Character to locate.** \
 *\_\_pos* **Index of character to search back from (default end).**

**Returns**

**Index of last occurrence.**

**Starting from** *\_\_pos***, searches backward for** *\_\_c* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**Note: equivalent to rfind(c, pos).**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_last\_of (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos = npos) const \[inline\], \[noexcept\]

**Find last position of a character of string.**

**Parameters**

*\_\_str* **String containing characters to locate.** \
 *\_\_pos* **Index of character to search back from (default end).**

**Returns**

**Index of last occurrence.**

**Starting from** *\_\_pos***, searches backward for one of the characters of** *\_\_str* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_last\_of(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_last\_of().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_last\_of (const \_CharT \* \_\_s, size\_type \_\_pos, size\_type \_\_n) const

**Find last position of a character of C substring.**

**Parameters**

*\_\_s* **C string containing characters to locate.** \
 *\_\_pos* **Index of character to search back from.** \
 *\_\_n* **Number of characters from s to search for.**

**Returns**

**Index of last occurrence.**

**Starting from** *\_\_pos***, searches backward for one of the first** *\_\_n* **characters of** *\_\_s* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**References npos, and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::find\_last\_of (const \_CharT \* \_\_s, size\_type \_\_pos = npos) const \[inline\]

**Find last position of a character of C string.**

**Parameters**

*\_\_s* **C string containing characters to locate.** \
 *\_\_pos* **Index of character to search back from (default end).**

**Returns**

**Index of last occurrence.**

**Starting from** *\_\_pos***, searches backward for one of the characters of** *\_\_s* **within this string. If found, returns the index where it was found. If not found, returns npos.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_reference \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::front () const \[inline\], \[noexcept\]

**Returns a read-only (constant) reference to the data at the first element of the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> reference \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::front () \[inline\], \[noexcept\]

**Returns a read/write reference to the data at the first element of the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> allocator\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::get\_allocator () const \[inline\], \[noexcept\]

**Return copy of allocator used to construct this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::insert (const\_iterator \_\_p, \_CharT \_\_c) \[inline\]

**Insert one character.**

**Parameters**

*\_\_p* **Iterator referencing position in string to insert at.** \
 *\_\_c* **The character to insert.**

**Returns**

**Iterator referencing newly inserted char.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Inserts character** *\_\_c* **at position referenced by** *\_\_p***. If adding character causes the length to exceed max\_size(), length\_error is thrown. If** *\_\_p* **is beyond end of string, out\_of\_range is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::insert (const\_iterator \_\_p, \_InputIterator \_\_beg, \_InputIterator \_\_end) \[inline\]

**Insert a range of characters.**

**Parameters**

*\_\_p* **Const\_iterator referencing location in string to insert at.** \
 *\_\_beg* **Start of range.** \
 *\_\_end* **End of range.**

**Returns**

**Iterator referencing the first inserted char.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Inserts characters in range \[beg,end). If adding characters causes the length to exceed max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::insert (const\_iterator \_\_p, size\_type \_\_n, \_CharT \_\_c) \[inline\]

**Insert multiple characters.**

**Parameters**

*\_\_p* **Const\_iterator referencing location in string to insert at.** \
 *\_\_n* **Number of characters to insert** \
 *\_\_c* **The character to insert.**

**Returns**

**Iterator referencing the first inserted char.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Inserts** *\_\_n* **copies of character** *\_\_c* **starting at the position referenced by iterator** *\_\_p***. If adding characters causes the length to exceed max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::insert().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::insert (const\_iterator \_\_p, std::initializer\_list\< \_CharT \> \_\_l) \[inline\]

**Insert an initializer\_list of characters.**

**Parameters**

*\_\_p* **Const\_iterator referencing location in string to insert at.** \
 *\_\_l* **The initializer\_list of characters to insert.**

**Returns**

**Iterator referencing the first inserted char.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::insert (size\_type \_\_pos, const \_CharT \* \_\_s) \[inline\]

**Insert a C string.**

**Parameters**

*\_\_pos* **Iterator referencing location in string to insert at.** \
 *\_\_s* **The C string to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.** \
 **std::out\_of\_range If** *\_\_pos* **is beyond the end of this string.**

**Inserts the first** *\_\_n* **characters of** *\_\_s* **starting at** *\_\_pos***. If adding characters causes the length to exceed max\_size(), length\_error is thrown. If** *\_\_pos* **is beyond end(), out\_of\_range is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::insert (size\_type \_\_pos, const \_CharT \* \_\_s, size\_type \_\_n) \[inline\]

**Insert a C substring.**

**Parameters**

*\_\_pos* **Iterator referencing location in string to insert at.** \
 *\_\_s* **The C string to insert.** \
 *\_\_n* **The number of characters to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.** \
 **std::out\_of\_range If** *\_\_pos* **is beyond the end of this string.**

**Inserts the first** *\_\_n* **characters of** *\_\_s* **starting at** *\_\_pos***. If adding characters causes the length to exceed max\_size(), length\_error is thrown. If** *\_\_pos* **is beyond end(), out\_of\_range is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::insert (size\_type \_\_pos, size\_type \_\_n, \_CharT \_\_c) \[inline\]

**Insert multiple characters.**

**Parameters**

*\_\_pos* **Index in string to insert at.** \
 *\_\_n* **Number of characters to insert** \
 *\_\_c* **The character to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.** \
 **std::out\_of\_range If** *\_\_pos* **is beyond the end of this string.**

**Inserts** *\_\_n* **copies of character** *\_\_c* **starting at index** *\_\_pos***. If adding characters causes the length to exceed max\_size(), length\_error is thrown. If** *\_\_pos* **\> length(), out\_of\_range is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::insert (size\_type \_\_pos1, const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) \[inline\]

**Insert value of a string.**

**Parameters**

*\_\_pos1* **Iterator referencing location in string to insert at.** \
 *\_\_str* **The string to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Inserts value of** *\_\_str* **starting at** *\_\_pos1***. If adding characters causes the length to exceed max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::insert (size\_type \_\_pos1, const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos2, size\_type \_\_n) \[inline\]

**Insert a substring.**

**Parameters**

*\_\_pos1* **Iterator referencing location in string to insert at.** \
 *\_\_str* **The string to insert.** \
 *\_\_pos2* **Start of characters in str to insert.** \
 *\_\_n* **Number of characters to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.** \
 **std::out\_of\_range If** *\_\_pos1* **\> size() or** *\_\_pos2* **\>** *\_\_str.size()***.**

**Starting at** *\_\_pos1***, insert** *\_\_n* **character of** *\_\_str* **beginning with** *\_\_pos2***. If adding characters causes the length to exceed max\_size(), length\_error is thrown. If** *\_\_pos1* **is beyond the end of this string or** *\_\_pos2* **is beyond the end of** *\_\_str***, out\_of\_range is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::length () const \[inline\], \[noexcept\]

**Returns the number of characters in the string, not including any null-termination.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::max\_size () const \[inline\], \[noexcept\]

**Returns the size() of the largest possible string.**

**Referenced by std::getline().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator+= (\_CharT \_\_c) \[inline\]

**Append a character.**

**Parameters**

*\_\_c* **The character to append.**

**Returns**

**Reference to this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator+= (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) \[inline\]

**Append a string to this string.**

**Parameters**

*\_\_str* **The string to append.**

**Returns**

**Reference to this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator+= (const \_CharT \* \_\_s) \[inline\]

**Append a C string.**

**Parameters**

*\_\_s* **The C string to append.**

**Returns**

**Reference to this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator+= (std::initializer\_list\< \_CharT \> \_\_l) \[inline\]

**Append an initializer\_list of characters.**

**Parameters**

*\_\_l* **The initializer\_list of characters to be appended.**

**Returns**

**Reference to this string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator= (\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> && \_\_str) \[inline\], \[noexcept\]

**String move assignment operator.**

**Parameters**

*\_\_str* **Source string.**

**The contents of** *\_\_str* **are moved into this string (without copying).** *\_\_str* **is a valid, but unspecified string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator= (\_CharT \_\_c) \[inline\]

**Set value to string of length 1.**

**Parameters**

*\_\_c* **Source character.**

**Assigning to a character makes this string length 1 and (\*this)\[0\] ==** *\_\_c***.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator= (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) \[inline\]

**Assign the value of** *str* **to this string.**

**Parameters**

*\_\_str* **Source string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator= (const \_CharT \* \_\_s) \[inline\]

**Copy contents of** *\_\_s* **into this string.**

**Parameters**

*\_\_s* **Source null-terminated string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator= (std::initializer\_list\< \_CharT \> \_\_l) \[inline\]

**Set value to string constructed from initializer list.**

**Parameters**

*\_\_l* **std::initializer\_list.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_reference \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator\[\] (size\_type \_\_pos) const \[inline\], \[noexcept\]

**Subscript access to the data contained in the string.**

**Parameters**

*\_\_pos* **The index of the character to access.**

**Returns**

**Read-only (constant) reference to the character.**

**This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out\_of\_range lookups are not defined. (For checked lookups see at().)**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::back(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::back(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::front(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::front().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> reference \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::operator\[\] (size\_type \_\_pos) \[inline\], \[noexcept\]

**Subscript access to the data contained in the string.**

**Parameters**

*\_\_pos* **The index of the character to access.**

**Returns**

**Read/write reference to the character.**

**This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out\_of\_range lookups are not defined. (For checked lookups see at().) Unshares the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> void \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::pop\_back () \[inline\]

**Remove the last character. The string must be non-empty.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> void \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::push\_back (\_CharT \_\_c) \[inline\]

**Append a single character.**

**Parameters**

*\_\_c* **Character to append.**

**Referenced by \_\_gnu\_cxx::operator+(), \_\_gnu\_cxx::operator+(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::operator+=().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_reverse\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::rbegin () const \[inline\], \[noexcept\]

**Returns a read-only (constant) reverse iterator that points to the last character in the string. Iteration is done in reverse element order.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> reverse\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::rbegin () \[inline\], \[noexcept\]

**Returns a read/write reverse iterator that points to the last character in the string. Iteration is done in reverse element order. Unshares the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const\_reverse\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::rend () const \[inline\], \[noexcept\]

**Returns a read-only (constant) reverse iterator that points to one before the first character in the string. Iteration is done in reverse element order.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> reverse\_iterator \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::rend () \[inline\], \[noexcept\]

**Returns a read/write reverse iterator that points to one before the first character in the string. Iteration is done in reverse element order. Unshares the string.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> template\<class \_InputIterator, typename = std::\_RequireInputIter\<\_InputIterator\>\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (const\_iterator \_\_i1, const\_iterator \_\_i2, \_InputIterator \_\_k1, \_InputIterator \_\_k2) \[inline\]

**Replace range of characters with range.**

**Parameters**

*\_\_i1* **Iterator referencing start of range to replace.** \
 *\_\_i2* **Iterator referencing end of range to replace.** \
 *\_\_k1* **Iterator referencing start of range to insert.** \
 *\_\_k2* **Iterator referencing end of range to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[i1,i2). In place, characters in the range \[k1,k2) are inserted. If the length of result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (const\_iterator \_\_i1, const\_iterator \_\_i2, const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) \[inline\]

**Replace range of characters with string.**

**Parameters**

*\_\_i1* **Iterator referencing start of range to replace.** \
 *\_\_i2* **Iterator referencing end of range to replace.** \
 *\_\_str* **String value to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[i1,i2). In place, the value of** *\_\_str* **is inserted. If the length of result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (const\_iterator \_\_i1, const\_iterator \_\_i2, const \_CharT \* \_\_s) \[inline\]

**Replace range of characters with C string.**

**Parameters**

*\_\_i1* **Iterator referencing start of range to replace.** \
 *\_\_i2* **Iterator referencing end of range to replace.** \
 *\_\_s* **C string value to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[i1,i2). In place, the characters of** *\_\_s* **are inserted. If the length of result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (const\_iterator \_\_i1, const\_iterator \_\_i2, const \_CharT \* \_\_s, size\_type \_\_n) \[inline\]

**Replace range of characters with C substring.**

**Parameters**

*\_\_i1* **Iterator referencing start of range to replace.** \
 *\_\_i2* **Iterator referencing end of range to replace.** \
 *\_\_s* **C string value to insert.** \
 *\_\_n* **Number of characters from s to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[i1,i2). In place, the first** *n* **characters of** *\_\_s* **are inserted. If the length of result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (const\_iterator \_\_i1, const\_iterator \_\_i2, size\_type \_\_n, \_CharT \_\_c) \[inline\]

**Replace range of characters with multiple characters.**

**Parameters**

*\_\_i1* **Iterator referencing start of range to replace.** \
 *\_\_i2* **Iterator referencing end of range to replace.** \
 *\_\_n* **Number of characters to insert.** \
 *\_\_c* **Character to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[i1,i2). In place,** *\_\_n* **copies of** *\_\_c* **are inserted. If the length of result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (const\_iterator \_\_i1, const\_iterator \_\_i2, std::initializer\_list\< \_CharT \> \_\_l) \[inline\]

**Replace range of characters with initializer\_list.**

**Parameters**

*\_\_i1* **Iterator referencing start of range to replace.** \
 *\_\_i2* **Iterator referencing end of range to replace.** \
 *\_\_l* **The initializer\_list of characters to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[i1,i2). In place, characters in the range \[k1,k2) are inserted. If the length of result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (size\_type \_\_pos, size\_type \_\_n, const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str) \[inline\]

**Replace characters with value from another string.**

**Parameters**

*\_\_pos* **Index of first character to replace.** \
 *\_\_n* **Number of characters to be replaced.** \
 *\_\_str* **String to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::out\_of\_range If** *\_\_pos* **is beyond the end of this string.** \
 **std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[pos,pos+n) from this string. In place, the value of** *\_\_str* **is inserted. If** *\_\_pos* **is beyond end of string, out\_of\_range is thrown. If the length of the result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::append(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::assign(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::insert(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::insert(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::insert(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::insert(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::insert(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::insert(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::replace(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::replace(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::replace(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::replace(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::replace(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::replace(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::replace().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (size\_type \_\_pos, size\_type \_\_n1, const \_CharT \* \_\_s) \[inline\]

**Replace characters with value of a C string.**

**Parameters**

*\_\_pos* **Index of first character to replace.** \
 *\_\_n1* **Number of characters to be replaced.** \
 *\_\_s* **C string to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::out\_of\_range If** *\_\_pos* **\> size().** \
 **std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[pos,pos + n1) from this string. In place, the characters of** *\_\_s* **are inserted. If** *pos* **is beyond end of string, out\_of\_range is thrown. If the length of result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (size\_type \_\_pos, size\_type \_\_n1, const \_CharT \* \_\_s, size\_type \_\_n2) \[inline\]

**Replace characters with value of a C substring.**

**Parameters**

*\_\_pos* **Index of first character to replace.** \
 *\_\_n1* **Number of characters to be replaced.** \
 *\_\_s* **C string to insert.** \
 *\_\_n2* **Number of characters from** *\_\_s* **to use.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::out\_of\_range If** *\_\_pos1* **\> size().** \
 **std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[pos,pos + n1) from this string. In place, the first** *\_\_n2* **characters of** *\_\_s* **are inserted, or all of** *\_\_s* **if** *\_\_n2* **is too large. If** *\_\_pos* **is beyond end of string, out\_of\_range is thrown. If the length of result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (size\_type \_\_pos, size\_type \_\_n1, size\_type \_\_n2, \_CharT \_\_c) \[inline\]

**Replace characters with multiple characters.**

**Parameters**

*\_\_pos* **Index of first character to replace.** \
 *\_\_n1* **Number of characters to be replaced.** \
 *\_\_n2* **Number of characters to insert.** \
 *\_\_c* **Character to insert.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::out\_of\_range If** *\_\_pos* **\> size().** \
 **std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[pos,pos + n1) from this string. In place,** *\_\_n2* **copies of** *\_\_c* **are inserted. If** *\_\_pos* **is beyond end of string, out\_of\_range is thrown. If the length of result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string & \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::replace (size\_type \_\_pos1, size\_type \_\_n1, const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos2, size\_type \_\_n2) \[inline\]

**Replace characters with value from another string.**

**Parameters**

*\_\_pos1* **Index of first character to replace.** \
 *\_\_n1* **Number of characters to be replaced.** \
 *\_\_str* **String to insert.** \
 *\_\_pos2* **Index of first character of str to use.** \
 *\_\_n2* **Number of characters from str to use.**

**Returns**

**Reference to this string.**

**Exceptions**

**std::out\_of\_range If** *\_\_pos1* **\> size() or** *\_\_pos2* **\> str.size().** \
 **std::length\_error If new length exceeds** max\_size()**.**

**Removes the characters in the range \[pos1,pos1 + n) from this string. In place, the value of** *\_\_str* **is inserted. If** *\_\_pos* **is beyond end of string, out\_of\_range is thrown. If the length of the result exceeds max\_size(), length\_error is thrown. The value of the string doesn't change if an error is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> void \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::reserve (size\_type \_\_res\_arg = 0) \[inline\]

**Attempt to preallocate enough memory for specified number of characters.**

**Parameters**

*\_\_res\_arg* **Number of characters required.**

**Exceptions**

**std::length\_error If** *\_\_res\_arg* **exceeds** max\_size()**.**

**This function attempts to reserve enough memory for the string to hold the specified number of characters. If the number requested is more than max\_size(), length\_error is thrown.**

**The advantage of this function is that if optimal code is a necessity and the user can determine the string length that will be required, the user can reserve the memory in advance, and thus prevent a possible reallocation of memory and copying of string data.**

**Referenced by \_\_gnu\_cxx::operator+(), \_\_gnu\_cxx::operator+(), \_\_gnu\_cxx::operator+(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::shrink\_to\_fit().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> void \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::resize (size\_type \_\_n) \[inline\]

**Resizes the string to the specified number of characters.**

**Parameters**

*\_\_n* **Number of characters the string should contain.**

**This function will resize the string to the specified length. If the new size is smaller than the string's current size the string is truncated, otherwise the string is extended and new characters are default-constructed. For basic types such as char, this means setting them to 0.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> void \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::resize (size\_type \_\_n, \_CharT \_\_c)

**Resizes the string to the specified number of characters.**

**Parameters**

*\_\_n* **Number of characters the string should contain.** \
 *\_\_c* **Character to fill any new elements.**

**This function will resize the string to the specified number of characters. If the number is smaller than the string's current size the string is truncated, otherwise the string is extended and new elements are set to** *\_\_c***.**

**References append(), and size().**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::resize().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::rfind (\_CharT \_\_c, size\_type \_\_pos = npos) const \[noexcept\]

**Find last position of a character.**

**Parameters**

*\_\_c* **Character to locate.** \
 *\_\_pos* **Index of character to search back from (default end).**

**Returns**

**Index of last occurrence.**

**Starting from** *\_\_pos***, searches backward for** *\_\_c* **within this string. If found, returns the index where it was found. If not found, returns npos.**

**References npos, and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::rfind (const \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_str, size\_type \_\_pos = npos) const \[inline\], \[noexcept\]

**Find last position of a string.**

**Parameters**

*\_\_str* **String to locate.** \
 *\_\_pos* **Index of character to search back from (default end).**

**Returns**

**Index of start of last occurrence.**

**Starting from** *\_\_pos***, searches backward for value of** *\_\_str* **within this string. If found, returns the index where it begins. If not found, returns npos.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_last\_of(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::rfind(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::rfind().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::rfind (const \_CharT \* \_\_s, size\_type \_\_pos, size\_type \_\_n) const

**Find last position of a C substring.**

**Parameters**

*\_\_s* **C string to locate.** \
 *\_\_pos* **Index of character to search back from.** \
 *\_\_n* **Number of characters from s to search for.**

**Returns**

**Index of start of last occurrence.**

**Starting from** *\_\_pos***, searches backward for the first** *\_\_n* **characters in** *\_\_s* **within this string. If found, returns the index where it begins. If not found, returns npos.**

**References std::min(), npos, and size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::rfind (const \_CharT \* \_\_s, size\_type \_\_pos = npos) const \[inline\]

**Find last position of a C string.**

**Parameters**

*\_\_s* **C string to locate.** \
 *\_\_pos* **Index of character to start search at (default end).**

**Returns**

**Index of start of last occurrence.**

**Starting from** *\_\_pos***, searches backward for the value of** *\_\_s* **within this string. If found, returns the index where it begins. If not found, returns npos.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> void \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::shrink\_to\_fit () \[inline\], \[noexcept\]

**A non-binding request to reduce capacity() to size().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::size () const \[inline\], \[noexcept\]

**Returns the number of characters in the string, not including any null-termination.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::append(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::append(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::assign(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::assign(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::assign(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::assign(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::at(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::at(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::back(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::back(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::cend(), compare(), compare(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::compare(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::empty(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::end(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::end(), find(), find(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::find(), find\_first\_not\_of(), find\_first\_not\_of(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_first\_not\_of(), find\_first\_of(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_first\_of(), find\_last\_not\_of(), find\_last\_not\_of(), find\_last\_of(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::find\_last\_of(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::insert(), \_\_gnu\_cxx::operator+(), \_\_gnu\_cxx::operator+(), \_\_gnu\_cxx::operator+(), \_\_gnu\_cxx::operator+(), \_\_gnu\_cxx::operator+(), \_\_gnu\_cxx::operator==(), \_\_gnu\_cxx::operator==(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::operator\[\](), \_\_gnu\_cxx::\_\_versa\_string\< char \>::operator\[\](), \_\_gnu\_cxx::\_\_versa\_string\< char \>::pop\_back(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::push\_back(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::replace(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::replace(), resize(), rfind(), rfind(), and \_\_gnu\_cxx::\_\_versa\_string\< char \>::shrink\_to\_fit().**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> \_\_versa\_string \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::substr (size\_type \_\_pos = 0, size\_type \_\_n = npos) const \[inline\]

**Get a substring.**

**Parameters**

*\_\_pos* **Index of first character (default 0).** \
 *\_\_n* **Number of characters in substring (default remainder).**

**Returns**

**The new string.**

**Exceptions**

**std::out\_of\_range If pos \> size().**

**Construct and return a new string using the** *\_\_n* **characters starting at** *\_\_pos***. If the string is too short, use the remainder of the characters. If** *\_\_pos* **is beyond the end of the string, out\_of\_range is thrown.**

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> void \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::swap (\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \> & \_\_s) \[inline\], \[noexcept\]

**Swap contents with another string.**

**Parameters**

*\_\_s* **String to swap with.**

**Exchanges the contents of this string with that of** *\_\_s* **in constant time.**

**Referenced by \_\_gnu\_cxx::\_\_versa\_string\< char \>::assign(), \_\_gnu\_cxx::\_\_versa\_string\< char \>::operator=(), and \_\_gnu\_cxx::swap().**

## Member Data Documentation

### template\<typename \_CharT, typename \_Traits, typename \_Alloc, template\< typename, typename, typename \> class \_Base\> const size\_type \_\_gnu\_cxx::\_\_versa\_string\< \_CharT, \_Traits, \_Alloc, \_Base \>::npos \[static\]

**Value returned by various member functions when they fail.**

**Referenced by find(), find(), find\_first\_not\_of(), find\_first\_not\_of(), find\_first\_of(), find\_last\_not\_of(), find\_last\_not\_of(), find\_last\_of(), rfind(), and rfind().**

## Author

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