Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Fixed Size Array.

#include <boost/tr1/array.hpp>

or

#include <array>

Class template array is a fixed size array that is safer than and no less efficient than a C style array. Class array fulfils almost all of the requirements of a reversible-container (see Section 23.1, [lib.container.requirements] of the C++ Standard). For more information refer to the Boost.Array documentation.

namespace std {
namespace tr1 {

// [6.2.2] Class template array
template <class T, size_t N > struct array;

// Array comparisons
template <class T, size_t N> bool operator== (const array<T,N>& x, const array<T,N>& y);
template <class T, size_t N> bool operator< (const array<T,N>& x, const array<T,N>& y);
template <class T, size_t N> bool operator!= (const array<T,N>& x, const array<T,N>& y);
template <class T, size_t N> bool operator> (const array<T,N>& x, const array<T,N>& y);
template <class T, size_t N> bool operator>= (const array<T,N>& x, const array<T,N>& y);
template <class T, size_t N> bool operator<= (const array<T,N>& x, const array<T,N>& y);

// [6.2.2.2] Specialized algorithms
template <class T, size_t N > void swap(array<T,N>& x, array<T,N>& y);

// [6.2.2.5] Tuple interface to class template array
template <class T> class tuple_size; // forward declaration
template <int I, class T> class tuple_element; // forward declaration
template <class T, size_t N> struct tuple_size<array<T, N> >;
template <int I, class T, size_t N> struct tuple_element<I, array<T, N> >;
template <int I, class T, size_t N> T& get( array<T, N>&);
template <int I, class T, size_t N> const T& get(const array<T, N>&);

} // namespace tr1
} // namespace std

Configuration: Boost.Config should (automatically) define the macro BOOST_HAS_TR1_ARRAY if your standard library implements this part of TR1.

Standard Conformity: No known issues as of Boost-1.34 onwards.


PrevUpHomeNext