---
name: "std::__detail::_Nfa"
section: "3cxx"
platform: "linux"
package: "libstdc++-4.8-doc"
version: "4.8.4-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::__detail::_Nfa"
---

# std::\_\_detail::\_Nfa(3cxx)

## NAME

std::\_\_detail::\_Nfa -

## SYNOPSIS

Inherits **std::\_\_detail::\_Automaton**, and **std::vector\< \_State \>**.

### Public Types

typedef \
 **regex\_constants::syntax\_option\_type** **\_FlagT**"\
 typedef unsigned int **\_SizeT**\
 typedef **\_State** **\_StateT**\
 typedef \_Alloc **allocator\_type**\
 typedef \
 \_\_gnu\_cxx::\_\_normal\_iterator\
 \< const\_pointer, **vector** \> **const\_iterator**"\
 typedef \
 \_Alloc\_traits::const\_pointer **const\_pointer**"\
 typedef \
 \_Alloc\_traits::const\_reference **const\_reference**"\
 typedef **std::reverse\_iterator**\
 \< const\_iterator \> **const\_reverse\_iterator**"\
 typedef ptrdiff\_t **difference\_type**\
 typedef \
 \_\_gnu\_cxx::\_\_normal\_iterator\
 \< pointer, **vector** \> **iterator**"\
 typedef \_Base::pointer **pointer**\
 typedef \_Alloc\_traits::reference **reference**\
 typedef **std::reverse\_iterator**\
 \< iterator \> **reverse\_iterator**"\
 typedef size\_t **size\_type**\
 typedef **\_State** **value\_type**\

### Public Member Functions

**\_Nfa** (\_FlagT \_\_f)\
 const **\_StateSet** & **\_M\_final\_states** () const \
 **\_StateIdT** **\_M\_insert\_accept** ()\
 **\_StateIdT** **\_M\_insert\_alt** (**\_StateIdT** \_\_next, **\_StateIdT** \_\_alt)\
 **\_StateIdT** **\_M\_insert\_matcher** (**\_Matcher** \_\_m)\
 **\_StateIdT** **\_M\_insert\_subexpr\_begin** (const **\_Tagger** &\_\_t)\
 **\_StateIdT** **\_M\_insert\_subexpr\_end** (unsigned int \_\_i, const **\_Tagger** &\_\_t)\
 \_FlagT **\_M\_options** () const \
 **\_StateIdT** **\_M\_start** () const \
 \_SizeT **\_M\_sub\_count** () const \
 void **assign** (size\_type \_\_n, const value\_type &\_\_val)\
 void **assign** (\_InputIterator \_\_first, \_InputIterator \_\_last)\
 void **assign** (initializer\_list\< value\_type \> \_\_l)\
 reference **at** (size\_type \_\_n)\
 const\_reference **at** (size\_type \_\_n) const\
 reference **back** ()\
 const\_reference **back** () const\
 iterator **begin** () noexcept\
 const\_iterator **begin** () const noexcept\
 size\_type **capacity** () const noexcept\
 const\_iterator **cbegin** () const noexcept\
 const\_iterator **cend** () const noexcept\
 void **clear** () noexcept\
 **const\_reverse\_iterator** **crbegin** () const noexcept\
 **const\_reverse\_iterator** **crend** () const noexcept\
 **\_State** \* **data** () noexcept\
 const **\_State** \* **data** () const noexcept\
 iterator **emplace** (iterator \_\_position, \_Args &&...\_\_args)\
 void **emplace\_back** (\_Args &&...\_\_args)\
 bool **empty** () const noexcept\
 iterator **end** () noexcept\
 const\_iterator **end** () const noexcept\
 iterator **erase** (iterator \_\_position)\
 iterator **erase** (iterator \_\_first, iterator \_\_last)\
 reference **front** ()\
 const\_reference **front** () const\
 iterator **insert** (iterator \_\_position, const value\_type &\_\_x)\
 iterator **insert** (iterator \_\_position, value\_type &&\_\_x)\
 void **insert** (iterator \_\_position, initializer\_list\< value\_type \> \_\_l)\
 void **insert** (iterator \_\_position, size\_type \_\_n, const value\_type &\_\_x)\
 void **insert** (iterator \_\_position, \_InputIterator \_\_first, \_InputIterator \_\_last)\
 size\_type **max\_size** () const noexcept\
 reference **operator\[\]** (size\_type \_\_n)\
 const\_reference **operator\[\]** (size\_type \_\_n) const\
 void **pop\_back** ()\
 void **push\_back** (const value\_type &\_\_x)\
 void **push\_back** (value\_type &&\_\_x)\
 **reverse\_iterator** **rbegin** () noexcept\
 **const\_reverse\_iterator** **rbegin** () const noexcept\
 **reverse\_iterator** **rend** () noexcept\
 **const\_reverse\_iterator** **rend** () const noexcept\
 void **reserve** (size\_type \_\_n)\
 void **resize** (size\_type \_\_new\_size)\
 void **resize** (size\_type \_\_new\_size, const value\_type &\_\_x)\
 void **shrink\_to\_fit** ()\
 size\_type **size** () const noexcept\
 void **swap** (**vector** &\_\_x) noexcept(\_Alloc\_traits::\_S\_nothrow\_swap())\

### Protected Member Functions

pointer **\_M\_allocate** (size\_t \_\_n)\
 pointer **\_M\_allocate\_and\_copy** (size\_type \_\_n, \_ForwardIterator \_\_first, \_ForwardIterator \_\_last)\
 void **\_M\_assign\_aux** (\_InputIterator \_\_first, \_InputIterator \_\_last, **std::input\_iterator\_tag**)\
 void **\_M\_assign\_aux** (\_ForwardIterator \_\_first, \_ForwardIterator \_\_last, **std::forward\_iterator\_tag**)\
 void **\_M\_assign\_dispatch** (\_Integer \_\_n, \_Integer \_\_val, \_\_true\_type)\
 void **\_M\_assign\_dispatch** (\_InputIterator \_\_first, \_InputIterator \_\_last, \_\_false\_type)\
 size\_type **\_M\_check\_len** (size\_type \_\_n, const char \*\_\_s) const\
 void **\_M\_deallocate** (pointer \_\_p, size\_t \_\_n)\
 void **\_M\_default\_append** (size\_type \_\_n)\
 void **\_M\_default\_initialize** (size\_type \_\_n)\
 void **\_M\_emplace\_back\_aux** (\_Args &&...\_\_args)\
 void **\_M\_erase\_at\_end** (pointer \_\_pos)\
 void **\_M\_fill\_assign** (size\_type \_\_n, const value\_type &\_\_val)\
 void **\_M\_fill\_initialize** (size\_type \_\_n, const value\_type &\_\_value)\
 void **\_M\_fill\_insert** (iterator \_\_pos, size\_type \_\_n, const value\_type &\_\_x)\
 \_Tp\_alloc\_type & **\_M\_get\_Tp\_allocator** () noexcept\
 const \_Tp\_alloc\_type & **\_M\_get\_Tp\_allocator** () const noexcept\
 void **\_M\_initialize\_dispatch** (\_Integer \_\_n, \_Integer \_\_value, \_\_true\_type)\
 void **\_M\_initialize\_dispatch** (\_InputIterator \_\_first, \_InputIterator \_\_last, \_\_false\_type)\
 void **\_M\_insert\_aux** (iterator \_\_position, \_Args &&...\_\_args)\
 void **\_M\_insert\_dispatch** (iterator \_\_pos, \_Integer \_\_n, \_Integer \_\_val, \_\_true\_type)\
 void **\_M\_insert\_dispatch** (iterator \_\_pos, \_InputIterator \_\_first, \_InputIterator \_\_last, \_\_false\_type)\
 void **\_M\_range\_check** (size\_type \_\_n) const\
 void **\_M\_range\_initialize** (\_InputIterator \_\_first, \_InputIterator \_\_last, **std::input\_iterator\_tag**)\
 void **\_M\_range\_initialize** (\_ForwardIterator \_\_first, \_ForwardIterator \_\_last, **std::forward\_iterator\_tag**)\
 void **\_M\_range\_insert** (iterator \_\_pos, \_InputIterator \_\_first, \_InputIterator \_\_last, **std::input\_iterator\_tag**)\
 void **\_M\_range\_insert** (iterator \_\_pos, \_ForwardIterator \_\_first, \_ForwardIterator \_\_last, **std::forward\_iterator\_tag**)\
 bool **\_M\_shrink\_to\_fit** ()\
 allocator\_type **get\_allocator** () const noexcept\

### Protected Attributes

\_Vector\_impl **\_M\_impl**\

## Detailed Description

struct \_Nfa

A collection of all states making up an NFA.

An NFA is a 4-tuple M = (K, S, s, F), where K is a finite set of states, S is the alphabet of the NFA, s is the initial state, F is a set of final (accepting) states.

This NFA class is templated on S, a type that will hold values of the underlying alphabet (without regard to semantics of that alphabet). The other elements of the tuple are generated during construction of the NFA and are available through accessor member functions.

Definition at line 269 of file regex\_nfa.h.

## Member Function Documentation

### pointer std::vector\< \_State , \_Alloc \>::\_M\_allocate\_and\_copy (size\_type\_\_n, \_ForwardIterator\_\_first, \_ForwardIterator\_\_last)` [inline]`, ` [protected]`, ` [inherited]`

Memory expansion handler. Uses the member allocation function to obtain *n* bytes of memory, and then copies \[first,last) into it.

Definition at line 1135 of file stl\_vector.h.

### void std::vector\< \_State , \_Alloc \>::\_M\_range\_check (size\_type\_\_n) const` [inline]`, ` [protected]`, ` [inherited]`

Safety check used only from at().

Definition at line 791 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::size().

### void std::vector\< \_State , \_Alloc \>::assign (size\_type\_\_n, const value\_type &\_\_val)` [inline]`, ` [inherited]`

Assigns a given value to a vector.

**Parameters:**

*\_\_n* Number of elements to be assigned. \
 *\_\_val* Value to be assigned.

This function fills a vector with *\_\_n* copies of the given value. Note that the assignment completely changes the vector and that the resulting vector's size is the same as the number of elements assigned. Old data may be lost.

Definition at line 479 of file stl\_vector.h.

### void std::vector\< \_State , \_Alloc \>::assign (\_InputIterator\_\_first, \_InputIterator\_\_last)` [inline]`, ` [inherited]`

Assigns a range to a vector.

**Parameters:**

*\_\_first* An input iterator. \
 *\_\_last* An input iterator.

This function fills a vector with copies of the elements in the range \[\_\_first,\_\_last).

Note that the assignment completely changes the vector and that the resulting vector's size is the same as the number of elements assigned. Old data may be lost.

Definition at line 498 of file stl\_vector.h.

### void std::vector\< \_State , \_Alloc \>::assign (initializer\_list\< value\_type \>\_\_l)` [inline]`, ` [inherited]`

Assigns an initializer list to a vector.

**Parameters:**

*\_\_l* An initializer\_list.

This function fills a vector with copies of the elements in the initializer list *\_\_l*.

Note that the assignment completely changes the vector and that the resulting vector's size is the same as the number of elements assigned. Old data may be lost.

Definition at line 524 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::assign().

### reference std::vector\< \_State , \_Alloc \>::at (size\_type\_\_n)` [inline]`, ` [inherited]`

Provides access to the data contained in the vector.

**Parameters:**

*\_\_n* The index of the element for which data should be accessed.

**Returns:**

Read/write reference to data.

**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 vector. The function throws out\_of\_range if the check fails.

Definition at line 810 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::\_M\_range\_check().

### const\_reference std::vector\< \_State , \_Alloc \>::at (size\_type\_\_n) const` [inline]`, ` [inherited]`

Provides access to the data contained in the vector.

**Parameters:**

*\_\_n* The index of the element for which data should be accessed.

**Returns:**

Read-only (constant) reference to data.

**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 vector. The function throws out\_of\_range if the check fails.

Definition at line 828 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::\_M\_range\_check().

### reference std::vector\< \_State , \_Alloc \>::back ()` [inline]`, ` [inherited]`

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

Definition at line 855 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::end().

### const\_reference std::vector\< \_State , \_Alloc \>::back () const` [inline]`, ` [inherited]`

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

Definition at line 863 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::end().

### iterator std::vector\< \_State , \_Alloc \>::begin ()` [inline]`, ` [noexcept]`, ` [inherited]`

Returns a read/write iterator that points to the first element in the vector. Iteration is done in ordinary element order.

Definition at line 538 of file stl\_vector.h.

### const\_iterator std::vector\< \_State , \_Alloc \>::begin () const` [inline]`, ` [noexcept]`, ` [inherited]`

Returns a read-only (constant) iterator that points to the first element in the vector. Iteration is done in ordinary element order.

Definition at line 547 of file stl\_vector.h.

### size\_type std::vector\< \_State , \_Alloc \>::capacity () const` [inline]`, ` [noexcept]`, ` [inherited]`

Returns the total number of elements that the vector can hold before needing to allocate more memory.

Definition at line 725 of file stl\_vector.h.

### const\_iterator std::vector\< \_State , \_Alloc \>::cbegin () const` [inline]`, ` [noexcept]`, ` [inherited]`

Returns a read-only (constant) iterator that points to the first element in the vector. Iteration is done in ordinary element order.

Definition at line 611 of file stl\_vector.h.

### const\_iterator std::vector\< \_State , \_Alloc \>::cend () const` [inline]`, ` [noexcept]`, ` [inherited]`

Returns a read-only (constant) iterator that points one past the last element in the vector. Iteration is done in ordinary element order.

Definition at line 620 of file stl\_vector.h.

### void std::vector\< \_State , \_Alloc \>::clear ()` [inline]`, ` [noexcept]`, ` [inherited]`

Erases all the elements. Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

Definition at line 1125 of file stl\_vector.h.

### const\_reverse\_iterator std::vector\< \_State , \_Alloc \>::crbegin () const` [inline]`, ` [noexcept]`, ` [inherited]`

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

Definition at line 629 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::end().

### const\_reverse\_iterator std::vector\< \_State , \_Alloc \>::crend () const` [inline]`, ` [noexcept]`, ` [inherited]`

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

Definition at line 638 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::begin().

### \_State \* std::vector\< \_State , \_Alloc \>::data ()` [inline]`, ` [noexcept]`, ` [inherited]`

Returns a pointer such that \[data(), data() + size()) is a valid range. For a non-empty vector, data() == &front().

Definition at line 878 of file stl\_vector.h.

References std::\_\_addressof(), and std::vector\< \_Tp, \_Alloc \>::front().

### iterator std::vector\< \_State , \_Alloc \>::emplace (iterator\_\_position, \_Args &&...\_\_args)` [inherited]`

Inserts an object in vector before specified iterator.

**Parameters:**

*\_\_position* An iterator into the vector. \
 *\_\_args* Arguments.

**Returns:**

An iterator that points to the inserted data.

This function will insert an object of type T constructed with T(std::forward\<Args\>(args)...) before the specified location. Note that this kind of operation could be expensive for a vector and if it is frequently used the user should consider using std::list.

### bool std::vector\< \_State , \_Alloc \>::empty () const` [inline]`, ` [noexcept]`, ` [inherited]`

Returns true if the vector is empty. (Thus begin() would equal end().)

Definition at line 734 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::begin(), and std::vector\< \_Tp, \_Alloc \>::end().

### iterator std::vector\< \_State , \_Alloc \>::end ()` [inline]`, ` [noexcept]`, ` [inherited]`

Returns a read/write iterator that points one past the last element in the vector. Iteration is done in ordinary element order.

Definition at line 556 of file stl\_vector.h.

### const\_iterator std::vector\< \_State , \_Alloc \>::end () const` [inline]`, ` [noexcept]`, ` [inherited]`

Returns a read-only (constant) iterator that points one past the last element in the vector. Iteration is done in ordinary element order.

Definition at line 565 of file stl\_vector.h.

### iterator std::vector\< \_State , \_Alloc \>::erase (iterator\_\_position)` [inherited]`

Remove element at given position.

**Parameters:**

*\_\_position* Iterator pointing to element to be erased.

**Returns:**

An iterator pointing to the next element (or end()).

This function will erase the element at the given position and thus shorten the vector by one.

Note This operation could be expensive and if it is frequently used the user should consider using std::list. The user is also cautioned that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

### iterator std::vector\< \_State , \_Alloc \>::erase (iterator\_\_first, iterator\_\_last)` [inherited]`

Remove a range of elements.

**Parameters:**

*\_\_first* Iterator pointing to the first element to be erased. \
 *\_\_last* Iterator pointing to one past the last element to be erased.

**Returns:**

An iterator pointing to the element pointed to by *\_\_last* prior to erasing (or end()).

This function will erase the elements in the range \[\_\_first,\_\_last) and shorten the vector accordingly.

Note This operation could be expensive and if it is frequently used the user should consider using std::list. The user is also cautioned that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

### reference std::vector\< \_State , \_Alloc \>::front ()` [inline]`, ` [inherited]`

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

Definition at line 839 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::begin().

### const\_reference std::vector\< \_State , \_Alloc \>::front () const` [inline]`, ` [inherited]`

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

Definition at line 847 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::begin().

### iterator std::vector\< \_State , \_Alloc \>::insert (iterator\_\_position, const value\_type &\_\_x)` [inherited]`

Inserts given value into vector before specified iterator.

**Parameters:**

*\_\_position* An iterator into the vector. \
 *\_\_x* Data to be inserted.

**Returns:**

An iterator that points to the inserted data.

This function will insert a copy of the given value before the specified location. Note that this kind of operation could be expensive for a vector and if it is frequently used the user should consider using std::list.

### iterator std::vector\< \_State , \_Alloc \>::insert (iterator\_\_position, value\_type &&\_\_x)` [inline]`, ` [inherited]`

Inserts given rvalue into vector before specified iterator.

**Parameters:**

*\_\_position* An iterator into the vector. \
 *\_\_x* Data to be inserted.

**Returns:**

An iterator that points to the inserted data.

This function will insert a copy of the given rvalue before the specified location. Note that this kind of operation could be expensive for a vector and if it is frequently used the user should consider using std::list.

Definition at line 988 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::emplace(), and std::move().

### void std::vector\< \_State , \_Alloc \>::insert (iterator\_\_position, initializer\_list\< value\_type \>\_\_l)` [inline]`, ` [inherited]`

Inserts an initializer\_list into the vector.

**Parameters:**

*\_\_position* An iterator into the vector. \
 *\_\_l* An initializer\_list.

This function will insert copies of the data in the initializer\_list *l* into the vector before the location specified by *position*.

Note that this kind of operation could be expensive for a vector and if it is frequently used the user should consider using std::list.

Definition at line 1005 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::insert().

### void std::vector\< \_State , \_Alloc \>::insert (iterator\_\_position, size\_type\_\_n, const value\_type &\_\_x)` [inline]`, ` [inherited]`

Inserts a number of copies of given data into the vector.

**Parameters:**

*\_\_position* An iterator into the vector. \
 *\_\_n* Number of elements to be inserted. \
 *\_\_x* Data to be inserted.

This function will insert a specified number of copies of the given data before the location specified by *position*.

Note that this kind of operation could be expensive for a vector and if it is frequently used the user should consider using std::list.

Definition at line 1023 of file stl\_vector.h.

### void std::vector\< \_State , \_Alloc \>::insert (iterator\_\_position, \_InputIterator\_\_first, \_InputIterator\_\_last)` [inline]`, ` [inherited]`

Inserts a range into the vector.

**Parameters:**

*\_\_position* An iterator into the vector. \
 *\_\_first* An input iterator. \
 *\_\_last* An input iterator.

This function will insert copies of the data in the range \[\_\_first,\_\_last) into the vector before the location specified by *pos*.

Note that this kind of operation could be expensive for a vector and if it is frequently used the user should consider using std::list.

Definition at line 1044 of file stl\_vector.h.

### size\_type std::vector\< \_State , \_Alloc \>::max\_size () const` [inline]`, ` [noexcept]`, ` [inherited]`

Returns the size() of the largest possible vector.

Definition at line 650 of file stl\_vector.h.

References std::allocator\_traits\< \_Tp\_alloc\_type \>::max\_size().

### reference std::vector\< \_State , \_Alloc \>::operator\[\] (size\_type\_\_n)` [inline]`, ` [inherited]`

Subscript access to the data contained in the vector.

**Parameters:**

*\_\_n* The index of the element for which data should be accessed.

**Returns:**

Read/write reference to data.

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().)

Definition at line 770 of file stl\_vector.h.

### const\_reference std::vector\< \_State , \_Alloc \>::operator\[\] (size\_type\_\_n) const` [inline]`, ` [inherited]`

Subscript access to the data contained in the vector.

**Parameters:**

*\_\_n* The index of the element for which data should be accessed.

**Returns:**

Read-only (constant) reference to data.

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().)

Definition at line 785 of file stl\_vector.h.

### void std::vector\< \_State , \_Alloc \>::pop\_back ()` [inline]`, ` [inherited]`

Removes last element. This is a typical stack operation. It shrinks the vector by one.

Note that no data is returned, and if the last element's data is needed, it should be retrieved before pop\_back() is called.

Definition at line 937 of file stl\_vector.h.

### void std::vector\< \_State , \_Alloc \>::push\_back (const value\_type &\_\_x)` [inline]`, ` [inherited]`

Add data to the end of the vector.

**Parameters:**

*\_\_x* Data to be added.

This is a typical stack operation. The function creates an element at the end of the vector and assigns the given data to it. Due to the nature of a vector this operation can be done in constant time if the vector has preallocated space available.

Definition at line 901 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::end().

### reverse\_iterator std::vector\< \_State , \_Alloc \>::rbegin ()` [inline]`, ` [noexcept]`, ` [inherited]`

Returns a read/write reverse iterator that points to the last element in the vector. Iteration is done in reverse element order.

Definition at line 574 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::end().

### const\_reverse\_iterator std::vector\< \_State , \_Alloc \>::rbegin () const` [inline]`, ` [noexcept]`, ` [inherited]`

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

Definition at line 583 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::end().

### reverse\_iterator std::vector\< \_State , \_Alloc \>::rend ()` [inline]`, ` [noexcept]`, ` [inherited]`

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

Definition at line 592 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::begin().

### const\_reverse\_iterator std::vector\< \_State , \_Alloc \>::rend () const` [inline]`, ` [noexcept]`, ` [inherited]`

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

Definition at line 601 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::begin().

### void std::vector\< \_State , \_Alloc \>::reserve (size\_type\_\_n)` [inherited]`

Attempt to preallocate enough memory for specified number of elements.

**Parameters:**

*\_\_n* Number of elements required.

**Exceptions:**

*std::length\_error* If *n* exceeds `max_size()`.

This function attempts to reserve enough memory for the vector to hold the specified number of elements. 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 number of elements that will be required, the user can reserve the memory in advance, and thus prevent a possible reallocation of memory and copying of vector data.

### void std::vector\< \_State , \_Alloc \>::resize (size\_type\_\_new\_size)` [inline]`, ` [inherited]`

Resizes the vector to the specified number of elements.

**Parameters:**

*\_\_new\_size* Number of elements the vector should contain.

This function will resize the vector to the specified number of elements. If the number is smaller than the vector's current size the vector is truncated, otherwise default constructed elements are appended.

Definition at line 664 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::size().

### void std::vector\< \_State , \_Alloc \>::resize (size\_type\_\_new\_size, const value\_type &\_\_x)` [inline]`, ` [inherited]`

Resizes the vector to the specified number of elements.

**Parameters:**

*\_\_new\_size* Number of elements the vector should contain. \
 *\_\_x* Data with which new elements should be populated.

This function will resize the vector to the specified number of elements. If the number is smaller than the vector's current size the vector is truncated, otherwise the vector is extended and new elements are populated with given data.

Definition at line 684 of file stl\_vector.h.

References std::vector\< \_Tp, \_Alloc \>::end(), std::vector\< \_Tp, \_Alloc \>::insert(), and std::vector\< \_Tp, \_Alloc \>::size().

### void std::vector\< \_State , \_Alloc \>::shrink\_to\_fit ()` [inline]`, ` [inherited]`

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

Definition at line 716 of file stl\_vector.h.

### size\_type std::vector\< \_State , \_Alloc \>::size () const` [inline]`, ` [noexcept]`, ` [inherited]`

Returns the number of elements in the vector.

Definition at line 645 of file stl\_vector.h.

### void std::vector\< \_State , \_Alloc \>::swap (vector\< \_State \> &\_\_x)` [inline]`, ` [noexcept]`, ` [inherited]`

Swaps data with another vector.

**Parameters:**

*\_\_x* A vector of the same element and allocator types.

This exchanges the elements between two vectors in constant time. (Three pointers, so it should be quite fast.) Note that the global std::swap() function is specialized such that std::swap(v1,v2) will feed to this function.

Definition at line 1108 of file stl\_vector.h.

## Author

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