##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::dynarray

From cppreference.com
< cpp‎ | container

| After reviewing national body comments to n3690, this library component was voted out from C++14 working paper into a separate Technical Specification. This container is not a part of the draft C++14 as of n3797

Defined in header `<dynarray>` |  |
template< class T > class dynarray; |  | (since C++14)

`std::dynarray` is a sequence container that encapsulates arrays with a size that is fixed at construction and does not change throughout the lifetime of the object.

The elements are stored contiguously, which means that elements can be accessed not only through iterators, but also using offsets on regular pointers to elements. This means that a pointer to an element of a dynarray may be passed to any function that expects a pointer to an element of an array.

There is a special case for a zero-length array (the number of elements was specified as zero during construction). In that case, array.begin() == array.end(), which is some unique value. The effect of calling front() or back() on a zero-sized `dynarray` is undefined.

### [edit] Template parameters

| This section is incomplete

### [edit] Member types

Member type | Definition
`value_type` | `T` [edit]
`size_type` | std::size_t [edit]
`difference_type` | std::ptrdiff_t [edit]
`reference` | `value_type&` [edit]
`const_reference` | `const value_type&` [edit]
`pointer` | `value_type*`[edit]
`const_pointer` | `const value_type*`[edit]
`iterator` | `RandomAccessIterator` [edit]
`const_iterator` | Constant random access iterator [edit]
`reverse_iterator` | std::reverse_iterator<iterator> [edit]
`const_reverse_iterator` | std::reverse_iterator<const_iterator> [edit]

### [edit] Member functions

(constructor) | constructs the `dynarray` (public member function) [edit]
(destructor) | destructs the `dynarray` (public member function) [edit]
operator= [deleted] | the container is neither copy-, nor move-assignable (public member function) [edit]
##### Element access
at | access specified element with bounds checking (public member function) [edit]
operator[] | access specified element (public member function) [edit]
front | access the first element (public member function) [edit]
back | access the last element (public member function) [edit]
data | direct access to the underlying array (public member function) [edit]
##### Iterators
begin cbegin | returns an iterator to the beginning (public member function) [edit]
end cend | returns an iterator to the end (public member function) [edit]
rbegin crbegin | returns a reverse iterator to the beginning (public member function) [edit]
rend crend | returns a reverse iterator to the end (public member function) [edit]
##### Capacity
empty | checks whether the container is empty (public member function) [edit]
size | returns the number of elements (public member function) [edit]
max_size | returns the maximum possible number of elements (public member function) [edit]
##### Modifiers
fill | fill the container with specified value (public member function) [edit]

### [edit] Non-member functions

operator==operator!=operator<operator<=operator>operator>= | lexicographically compares the values in the dynarray (function template) [edit]

### [edit] Helper classes

std::uses_allocator<std::dynarray> (C++11) | specializes the std::uses_allocator type trait (function template) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/container/dynarray&oldid=65917"
Category:

- Todo without reason