Array
Boost.Array Library
Classes
boost Namespace Reference

Classes

class  array
 A container that encapsulates fixed size arrays. More...
 

Functions

Comparisons
template<class T , std::size_t N>
bool operator== (const array< T, N > &x, const array< T, N > &y)
 Lexicographically compares the values in the array (. More...
 
template<class T , std::size_t N>
bool operator< (const array< T, N > &x, const array< T, N > &y)
 Lexicographically compares the values in the array (operator<) More...
 
template<class T , std::size_t N>
bool operator!= (const array< T, N > &x, const array< T, N > &y)
 Lexicographically compares the values in the array (operator!=) More...
 
template<class T , std::size_t N>
bool operator> (const array< T, N > &x, const array< T, N > &y)
 Lexicographically compares the values in the array (operator>) More...
 
template<class T , std::size_t N>
bool operator<= (const array< T, N > &x, const array< T, N > &y)
 Lexicographically compares the values in the array (operator<=) More...
 
template<class T , std::size_t N>
bool operator>= (const array< T, N > &x, const array< T, N > &y)
 Lexicographically compares the values in the array (operator>=) More...
 
Non-member functions
template<class T , std::size_t N>
void swap (array< T, N > &x, array< T, N > &y)
 Global swap function. More...
 
template<typename T , std::size_t N>
T(& get_c_array (boost::array< T, N > &arg))[N]
 
template<typename T , std::size_t N>
const T(& get_c_array (const boost::array< T, N > &arg))[N]
 
template<class It >
std::size_t hash_range (It, It)
 Calculate combined hash value of the elements of an iterator range. More...
 
template<class T , std::size_t N>
std::size_t hash_value (const array< T, N > &arr)
 Calculate hash value for an array. More...
 
template<size_t Idx, typename T , size_t N>
T & get (boost::array< T, N > &arr) noexcept
 Extracts the Ith element from the array. More...
 
template<size_t Idx, typename T , size_t N>
const T & get (const boost::array< T, N > &arr) noexcept
 Extracts the Ith element from a constant array. More...
 

Function Documentation

◆ get() [1/2]

template<size_t Idx, typename T , size_t N>
T & boost::get ( boost::array< T, N > &  arr)
noexcept

Extracts the Ith element from the array.

This function wxtracts the Idx -th element element from the array.

Unlike at and operator[], the condition that Idx is in the range [0,N) is enforced at compile-time.

Complexity

Constant

Preconditions

Idx < size()

Template Parameters
IdxElement index to extract
Tarray value type
Narray size
Returns
A reference to the Ith element of arr
Parameters
arrarray whose contents to extract
See also

See Also at, operator[]

◆ get() [2/2]

template<size_t Idx, typename T , size_t N>
const T & boost::get ( const boost::array< T, N > &  arr)
noexcept

Extracts the Ith element from a constant array.

This function wxtracts the Idx -th element element from a constant array.

Unlike at and operator[], the condition that Idx is in the range [0,N) is enforced at compile-time.

Complexity

Constant

Preconditions

Idx < size()

Template Parameters
IdxElement index to extract
Tarray value type
Narray size
Returns
A constant reference to the Ith element of arr
Parameters
arrarray whose contents to extract
See also

See Also at, operator[]

◆ get_c_array() [1/2]

template<typename T , std::size_t N>
T(& boost::get_c_array ( boost::array< T, N > &  arg) )[N]

◆ get_c_array() [2/2]

template<typename T , std::size_t N>
const T(& boost::get_c_array ( const boost::array< T, N > &  arg) )[N]

◆ hash_range()

template<class It >
std::size_t boost::hash_range ( It  ,
It   
)

Calculate combined hash value of the elements of an iterator range.

Forward declaration for Boost.ContainerHash

Complexity

Linear

Note

This function is used to calculate the hash for an array

Returns
combined hash value of the elements in the range
Parameters
ItFirst element in the range
ItSecond element in the range
See also

See Also hash_value

◆ hash_value()

template<class T , std::size_t N>
std::size_t boost::hash_value ( const array< T, N > &  arr)

Calculate hash value for an array.

This function calculates the hash value for an array

Complexity

Linear

Note

This function is used to calculate the hash for an array, which allows it to be inserted in unordered containers.

Returns
hash value for an array
Parameters
arrArray for which we calculate the hash
See also

See Also hash_range

◆ operator!=()

template<class T , std::size_t N>
bool boost::operator!= ( const array< T, N > &  x,
const array< T, N > &  y 
)

Lexicographically compares the values in the array (operator!=)

This function lexicographically compares the values in the array.

Complexity

Linear

Template Parameters
Tarray value type
Narray size
Returns
true if x != y
Parameters
xFirst array whose contents to compare
ySecond array whose contents to compare

◆ operator<()

template<class T , std::size_t N>
bool boost::operator< ( const array< T, N > &  x,
const array< T, N > &  y 
)

Lexicographically compares the values in the array (operator<)

This function lexicographically compares the values in the array.

Complexity

Linear

Template Parameters
Tarray value type
Narray size
Returns
true if x < y
Parameters
xFirst array whose contents to compare
ySecond array whose contents to compare

◆ operator<=()

template<class T , std::size_t N>
bool boost::operator<= ( const array< T, N > &  x,
const array< T, N > &  y 
)

Lexicographically compares the values in the array (operator<=)

This function lexicographically compares the values in the array.

Complexity

Linear

Template Parameters
Tarray value type
Narray size
Returns
true if x <= y
Parameters
xFirst array whose contents to compare
ySecond array whose contents to compare

◆ operator==()

template<class T , std::size_t N>
bool boost::operator== ( const array< T, N > &  x,
const array< T, N > &  y 
)

Lexicographically compares the values in the array (.

Template Parameters

This function lexicographically compares the values in the array.

Complexity

Linear

Template Parameters
Tarray value type
Narray size
Returns
true if x tparam y
Parameters
xFirst array whose contents to compare
ySecond array whose contents to compare

◆ operator>()

template<class T , std::size_t N>
bool boost::operator> ( const array< T, N > &  x,
const array< T, N > &  y 
)

Lexicographically compares the values in the array (operator>)

This function lexicographically compares the values in the array.

Complexity

Linear

Template Parameters
Tarray value type
Narray size
Returns
true if x > y
Parameters
xFirst array whose contents to compare
ySecond array whose contents to compare

◆ operator>=()

template<class T , std::size_t N>
bool boost::operator>= ( const array< T, N > &  x,
const array< T, N > &  y 
)

Lexicographically compares the values in the array (operator>=)

This function lexicographically compares the values in the array.

Complexity

Linear

Template Parameters
Tarray value type
Narray size
Returns
true if x >= y
Parameters
xFirst array whose contents to compare
ySecond array whose contents to compare

◆ swap()

template<class T , std::size_t N>
void boost::swap ( array< T, N > &  x,
array< T, N > &  y 
)

Global swap function.

This function swaps the contents of two arrays with the array swap member function.

Complexity

Linear

Template Parameters
Tarray value type
Narray size
Returns
(none)
Parameters
xFirst array whose contents to swap
ySecond array whose contents to swap