---
name: "std::array"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::array/3cxx"
---

# std::array(3cxx)

A standard container for storing a fixed size sequence of elements.

## NAME

std::array\< \_Tp, \_Nm \> - A standard container for storing a fixed size sequence of elements.

## SYNOPSIS

`#include <array>`

### Public Types

**typedef** \_\_array\_traits\< \_Tp, **\_Nm** \> **\_AT\_Type**\
 **typedef** const value\_type \* **const\_iterator**\
 **typedef** const value\_type \* **const\_pointer**\
 **typedef** const value\_type & **const\_reference**\
 **typedef** **std::reverse\_iterator**\< const\_iterator \> **const\_reverse\_iterator**\
 **typedef** std::ptrdiff\_t **difference\_type**\
 **typedef** value\_type \* **iterator**\
 **typedef** value\_type \* **pointer**\
 **typedef** value\_type & **reference**\
 **typedef** **std::reverse\_iterator**\< iterator \> **reverse\_iterator**\
 **typedef** std::size\_t **size\_type**\
 **typedef** \_Tp **value\_type**\

### Public Member Functions

constexpr reference **at** (size\_type \_\_n)\
 constexpr const\_reference **at** (size\_type \_\_n) const\
 constexpr const\_reference **back** () const noexcept\
 constexpr reference **back** () noexcept\
 constexpr const\_iterator **begin** () const noexcept\
 constexpr iterator **begin** () noexcept\
 constexpr const\_iterator **cbegin** () const noexcept\
 constexpr const\_iterator **cend** () const noexcept\
 constexpr **const\_reverse\_iterator** **crbegin** () const noexcept\
 constexpr **const\_reverse\_iterator** **crend** () const noexcept\
 constexpr const\_pointer **data** () const noexcept\
 constexpr pointer **data** () noexcept\
 constexpr bool **empty** () const noexcept\
 constexpr const\_iterator **end** () const noexcept\
 constexpr iterator **end** () noexcept\
 constexpr **void** **fill** (const value\_type &**\_\_u**)\
 constexpr const\_reference **front** () const noexcept\
 constexpr reference **front** () noexcept\
 constexpr size\_type **max\_size** () const noexcept\
 constexpr const\_reference **operator\[\]** (size\_type \_\_n) const noexcept\
 constexpr reference **operator\[\]** (size\_type \_\_n) noexcept\
 constexpr **const\_reverse\_iterator** **rbegin** () const noexcept\
 constexpr **reverse\_iterator** **rbegin** () noexcept\
 constexpr **const\_reverse\_iterator** **rend** () const noexcept\
 constexpr **reverse\_iterator** **rend** () noexcept\
 constexpr size\_type **size** () const noexcept\
 constexpr **void** **swap** (**array** &\_\_other) noexcept(\_AT\_Type::\_Is\_nothrow\_swappable::value)\

### Public Attributes

\_AT\_Type::\_Type **\_M\_elems**\

## Detailed Description

### template\<typename \_Tp, std::size\_t \_Nm\>

struct std::array\< \_Tp, \_Nm \>"A standard container for storing a fixed size sequence of elements.

Meets the requirements of a `container`, a `reversible container`, and a `sequence`.

Sets support random access iterators.

**Template Parameters**

*Tp* Type of element. Required to be a complete type. \
 *Nm* Number of elements.

## Author

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