std::dynarray::empty

bool empty() const; (since {std}) 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 Template:cpp/container/dynarray/example empty See also size returns the number of elements (public member function)

std::dynarray::dynarray

explicit dynarray( size_type count ); (1) (since C++14) template< class Alloc > dynarray( size_type count, const Alloc& alloc ); (2) (since C++14) dynarray( size_type count, const T& value ); (3) (since C++14) template< class Alloc > dynarray( size_type count, const T& value, const Alloc& alloc ); (4) (since C++14) dynarray( const dynarray& other ); (5) (since C++14) template< class Alloc > dynarray( const dynarray& other,

std::dynarray::data

T* data(); (since {std}) const T* data() const; (since {std}) 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::dynarray::begin

iterator begin(); (since {std}) const_iterator begin() const; (since {std}) const_iterator cbegin() const; (since {std}) Returns an iterator to the first element of the container. If the container is empty, the returned iterator will be equal to end(). Parameters (none). Return value Iterator to the first element. Exceptions noexcept specification: noexcept Complexity Constant. Example See also end cend returns an iterator to the end (public member

std::dynarray::back

reference back(); (since {std}) const_reference back() const; (since {std}) Returns reference to the last element in the container. Calling back on an empty container is undefined. Parameters (none). Return value Reference to the last element. Complexity Constant. Notes For a container c, the expression return c.back(); is equivalent to { auto tmp = c.end(); --tmp; return *tmp; } Example The following code uses back to display the last element of a std::dynarray<

std::dynarray::at

reference at( size_type pos ); (since {std}) const_reference at( size_type pos ) const; 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 element. Exceptions std::out_of_range if !(pos < size()). Complexity Constant. See also oper

std::domain_error

Defined in header <stdexcept> class domain_error; Defines a type of object to be thrown as exception. It may be used by the implementation to report domain errors, that is, situations where the inputs are outside of the domain on which an operation is defined. The standard library components do not throw this exception (mathematical functions report domain errors as specified in math_errhandling). Third-party libraries, however, use this. For example, boost.math throws std:

std::divides&lt;void&gt;

Defined in header <functional> template<> class divides<void>; (since C++14) std::divides<> is a specialization of std::divides with parameter and return type deduced. Member types Member type Definition is_transparent /* unspecified */ Member functions operator() returns the quotient of two arguments (public member function) std::divides<>::operator() template< class T, class U> constexpr auto operator()( T&&am

std::divides

Defined in header <functional> template< class T > struct divides; (until C++14) template< class T = void > struct divides; (since C++14) Function object for performing division. Effectively calls operator/ on two instances of type T. Specializations The standard library provides a specialization of std::divides when T is not specified, which leaves the parameter types and return type to be deduced. divides<void> function object implementing

std::div

Defined in header <cstdlib> std::div_t div( int x, int y ); (1) std::ldiv_t div( long x, long y ); (2) std::lldiv_t div( long long x, long long y ); (3) (since C++11) std::ldiv_t ldiv( long x, long y ); (4) std::lldiv_t lldiv( long long x, long long y ); (5) (since C++11) Defined in header <cinttypes> std::imaxdiv_t div( std::intmax_t x, std::intmax_t y ); (6) (since C++11) std::imaxdiv_t imaxdiv( std::intmax_t x, std::in