• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. Sequences/Classes//vector_c |70
2
3vector_c
4========
5
6Description
7-----------
8
9``vector_c`` is an |Integral Sequence Wrapper| for |vector|. As such, it shares
10all |vector| characteristics and requirements, and differs only in the way the
11original sequence content is specified.
12
13Header
14------
15
16+-------------------+-----------------------------------------------------------+
17| Sequence form     | Header                                                    |
18+===================+===========================================================+
19| Variadic          | ``#include <boost/mpl/vector_c.hpp>``                     |
20+-------------------+-----------------------------------------------------------+
21| Numbered          | ``#include <boost/mpl/vector/vector``\ *n*\ ``_c.hpp>``   |
22+-------------------+-----------------------------------------------------------+
23
24
25Model of
26--------
27
28* |Integral Sequence Wrapper|
29* |Variadic Sequence|
30* |Random Access Sequence|
31* |Extensible Sequence|
32* |Back Extensible Sequence|
33* |Front Extensible Sequence|
34
35
36Expression semantics
37--------------------
38
39|Semantics disclaimer...| |vector|.
40
41.. workaround substitution bug (should be replace:: vector\ *n*\ _c<T,\ |c1...cn|>)
42.. |vectorn_c<T,...>| replace:: vector\ *n*\ _c<T,\ *c*\ :sub:`1`,\ *c*\ :sub:`2`,... \ *c*\ :sub:`n`\ >
43
44+-------------------------------------------+-----------------------------------------------+
45| Expression                                | Semantics                                     |
46+===========================================+===============================================+
47| .. parsed-literal::                       | A |vector| of integral constant wrappers      |
48|                                           | ``integral_c<T,``\ |c1|\ ``>``,               |
49|    vector_c<T,\ |c1...cn|>                | ``integral_c<T,``\ |c2|\ ``>``, ...           |
50|    |vectorn_c<T,...>|                     | ``integral_c<T,``\ |cn|\ ``>``;               |
51|                                           | see |Integral Sequence Wrapper|.              |
52+-------------------------------------------+-----------------------------------------------+
53| .. parsed-literal::                       | Identical to ``vector``\ *n*\ ``<``           |
54|                                           | ``integral_c<T,``\ |c1|\ ``>``,               |
55|    vector_c<T,\ |c1...cn|>::type          | ``integral_c<T,``\ |c2|\ ``>``, ...           |
56|    |vectorn_c<T,...>|::type               | ``integral_c<T,``\ |cn|\ ``>`` ``>``;         |
57|                                           | see |Integral Sequence Wrapper|.              |
58+-------------------------------------------+-----------------------------------------------+
59| .. parsed-literal::                       | Identical to ``T``; see                       |
60|                                           | |Integral Sequence Wrapper|.                  |
61|   vector_c<T,\ |c1...cn|>::value_type     |                                               |
62|   |vectorn_c<T,...>|::value_type          |                                               |
63+-------------------------------------------+-----------------------------------------------+
64
65
66Example
67-------
68
69.. parsed-literal::
70
71    typedef vector_c<int,1,1,2,3,5,8,13,21,34> fibonacci;
72    typedef push_back<fibonacci,int_<55> >::type fibonacci2;
73
74    BOOST_MPL_ASSERT_RELATION( front<fibonacci2>::type::value, ==, 1 );
75    BOOST_MPL_ASSERT_RELATION( back<fibonacci2>::type::value, ==, 55 );
76
77
78See also
79--------
80
81|Sequences|, |Integral Sequence Wrapper|, |vector|, |integral_c|, |set_c|, |list_c|, |range_c|
82
83
84.. copyright:: Copyright �  2001-2009 Aleksey Gurtovoy and David Abrahams
85   Distributed under the Boost Software License, Version 1.0. (See accompanying
86   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
87