Front Page / Sequences / Classes / vector_c

vector_c

Description

vector_c is an Integral Sequence Wrapper for vector. As such, it shares all vector characteristics and requirements, and differs only in the way the original sequence content is specified.

Header

Sequence form Header
Variadic #include <boost/mpl/vector_c.hpp>
Numbered #include <boost/mpl/vector/vectorn_c.hpp>

Model of

Expression semantics

The semantics of an expression are defined only where they differ from, or are not defined in vector.

Expression Semantics
vector_c<T,c1,c2,... cn>
vectorn_c<T,c1,c2,... cn>
A vector of integral constant wrappers integral_c<T,c1>, integral_c<T,c2>, ... integral_c<T,cn>; see Integral Sequence Wrapper.
vector_c<T,c1,c2,... cn>::type
vectorn_c<T,c1,c2,... cn>::type
Identical to vectorn< integral_c<T,c1>, integral_c<T,c2>, ... integral_c<T,cn> >; see Integral Sequence Wrapper.
vector_c<T,c1,c2,... cn>::value_type
vectorn_c<T,c1,c2,... cn>::value_type
Identical to T; see Integral Sequence Wrapper.

Example

typedef vector_c<int,1,1,2,3,5,8,13,21,34> fibonacci;
typedef push_back<fibonacci,int_<55> >::type fibonacci2;

BOOST_MPL_ASSERT_RELATION( front<fibonacci2>::type::value, ==, 1 );
BOOST_MPL_ASSERT_RELATION( back<fibonacci2>::type::value, ==, 55 );

See also

Sequences, Integral Sequence Wrapper, vector, integral_c, set_c, list_c, range_c