std::array::rend

reverse_iterator rend(); (since C++11) const_reverse_iterator rend() const; (since C++11) const_reverse_iterator crend() const; (since C++11) Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior. Parameters (none). Return value Reverse iterator to the

std::array::max_size

constexpr size_type max_size(); (since C++11) (until C++14) constexpr size_type max_size() const; (since C++14) Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container. Parameters (none). Return value Maximum number of elements. Exceptions noexcept specification: noexcept Complexity Constant. Notes Because each std::array<T, N> is a

std::array::data

T* data(); (since C++11) const T* data() const; (since C++11) Returns pointer to the underlying array serving as element storage. The pointer is such that range [data(); data() + size()) is always a valid range, even if the container is empty. Parameters (none). Return value Pointer to the underlying element storage. For non-empty containers, returns &front(). Complexity Constant. Exceptions noexcept specification: noexcept See also front access the first

std::array::rbegin

reverse_iterator rbegin(); (since C++11) const_reverse_iterator rbegin() const; (since C++11) const_reverse_iterator crbegin() const; (since C++11) Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. Parameters (none). Return value Reverse iterator to the first element. Exceptions noexcept specification: noexcept Complexity Constant. See also rend crend returns a

std::array::fill

void fill( const T& value ); (since C++11) Assigns the given value value to all elements in the container. Parameters value - the value to assign to the elements Return value (none). Complexity Linear in the size of the container.

std::array::front

reference front(); (since C++11) const_reference front() const; (since C++11) (until C++14) constexpr const_reference front() const; (since C++14) Returns a reference to the first element in the container. Calling front on an empty container is undefined. Parameters (none). Return value reference to the first element. Complexity Constant. Notes For a container c, the expression c.front() is equivalent to *c.begin(). Example The following code uses front to di

std::array::end

iterator end(); (since C++11) const_iterator end() const; (since C++11) const_iterator cend() const; (since C++11) Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior. Parameters (none). Return value Iterator to the element following the last element. Exceptions noexcept specification: noexcept Complexity Constant. See also begin cbegin

std::array::operator[]

reference operator[]( size_type pos ); (since C++11) const_reference operator[]( size_type pos ) const; (since C++11) (until C++14) constexpr const_reference operator[]( size_type pos ) const; (since C++14) Returns a reference to the element at specified location pos. No bounds checking is performed. Parameters pos - position of the element to return Return value Reference to the requested element. Complexity Constant. Notes Unlike std::map::operato

std::array::empty

constexpr bool empty(); (since C++11) (until C++14) constexpr bool empty() const; (since C++14) Checks if the container has no elements, i.e. whether begin() == end(). Parameters (none). Return value true if the container is empty, false otherwise. Exceptions noexcept specification: noexcept Complexity Constant. Example The following code uses empty to check if a std::array contains any elements: #include <array> #include <iostream> int main() {

std::array::at

reference at( size_type pos ); (since C++11) const_reference at( size_type pos ) const; (since C++11) (until C++14) constexpr const_reference at( size_type pos ) const; (since C++14) Returns a reference to the element at specified location pos, with bounds checking. If pos not within the range of the container, an exception of type std::out_of_range is thrown. Parameters pos - position of the element to return Return value Reference to the requested eleme