From Cppreference
Defined in header <array>
|
|
|
template<
class T,
size_t N
> struct array;
|
| (C++11 feature)
|
|
|
array
is a container that encapsulates constant size arrays.
This struct is designed to provide the benefits of a STL container (an array
knows its own size, supports assignment, etc.)
while still providing the performance of C-style arrays.
Member types
|
|
Member type
| Definition
|
|
value_type
| T
|
|
size_type
| size_t
|
|
size_type
| ptrdiff_t
|
|
reference
| value_type&
|
|
const_reference
| const value_type&
|
|
pointer
| T*
|
|
const_pointer
| const T*
|
|
iterator
| Random access iterator
|
|
const_iterator
| Constant random access iterator
|
|
reverse_iterator
| std::reverse_iterator<iterator>
|
|
const_reverse_iterator
| std::reverse_iterator<const_iterator>
|
Member functions
|
Element access
|
|
| access specified element with bounds checking (public member function)
|
|
| access specified element (public member function)
|
|
| access the first element (public member function)
|
|
| access the last element (public member function)
|
|
| direct access to the underlying array (public member function)
|
Iterators
|
|
| returns an iterator to the beginning (public member function)
|
|
| returns an iterator to the end (public member function)
|
|
| returns a reverse iterator to the beginning (public member function)
|
|
| returns a reverse iterator to the end (public member function)
|
Capacity
|
|
| checks whether the container is empty (public member function)
|
|
| returns the number of elements (public member function)
|
|
| returns the maximum possible number of elements (public member function)
|
Operations
|
|
| fill the container with specified value (public member function)
|
|
| swaps the contents (public member function)
|