The MPL Reference Manual: vector_c

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/vector`n`_c.hpp>`

### Model of

- Integral Sequence Wrapper
- Variadic Sequence
- Random Access Sequence
- Extensible Sequence
- Back Extensible Sequence
- Front Extensible Sequence

### 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 `vector`n`<` `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,2,3,5,7,12,19,31> fibonacci;
    typedef push_back<fibonacci,int_<50> >::type fibonacci2;

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

### See also

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