Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function template get

boost::get — Extracts the Ith element from the array.

Synopsis

// In header: <boost/array.hpp>


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

Description

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()

See Also:

at, operator[]

Parameters:

arr

array whose contents to extract

Template Parameters:

Idx

Element index to extract

N

array size

T

array value type

Returns:

A reference to the Ith element of arr


PrevUpHomeNext