std::enable_if

Defined in header <type_traits> template< bool B, class T = void > struct enable_if; (since C++11) If B is true, std::enable_if has a public member typedef type, equal to T; otherwise, there is no member typedef. This metafunction is a convenient way to leverage SFINAE to conditionally remove functions from overload resolution based on type traits and to provide separate function overloads and specializations for different type traits. std::enable_if can be used as an

std::empty

Defined in header <iterator> Defined in header <array> Defined in header <deque> Defined in header <forward_list> Defined in header <list> Defined in header <map> Defined in header <regex> Defined in header <set> Defined in header <string> Defined in header <unordered_map> Defined in header <unordered_set> Defined in header <vector> templat

std::dynarray::size

size_type size() const; (since {std}) Returns the number of elements in the container, i.e. std::distance(begin(), end()). Parameters (none). Return value The number of elements in the container. Exceptions noexcept specification: noexcept Complexity Constant. Example Template:cpp/container/dynarray/example size See also empty checks whether the container is empty (public member function) max_size returns the maximum possible number of elements (public me

std::dynarray::rend

reverse_iterator rend(); (since {std}) const_reverse_iterator rend() const; (since {std}) const_reverse_iterator crend() const; (since {std}) 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::dynarray::rbegin

reverse_iterator rbegin(); (since {std}) const_reverse_iterator rbegin() const; (since {std}) const_reverse_iterator crbegin() const; (since {std}) 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::dynarray::operator[]

reference operator[]( size_type pos ); (since {std}) const_reference operator[]( size_type pos ) const; (since {std}) 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::operator[], this operator never inserts a new element into the container. Example The following co

std::dynarray::max_size

size_type max_size() const; (since {std}) 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 This value is typically equal to std::numeric_limits<size_type>::max(), and reflects the theoretical limit on t

std::dynarray::front

reference front(); (since {std}) const_reference front() const; (since {std}) 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 display the first element of a std::dynarray<char>: #include <dynarr

std::dynarray::fill

void fill( const T& value ); (since {std}) 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::dynarray::end

iterator end(); (since {std}) const_iterator end() const; (since {std}) const_iterator cend() const; (since {std}) 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