1 .. Sequences/Concepts//Integral Sequence Wrapper |90
3 Integral Sequence Wrapper
4 =========================
9 An |Integral Sequence Wrapper| is a class template that provides a concise
10 interface for creating a corresponding sequence of |Integral Constant|\ s. In
11 particular, assuming that ``seq`` is a name of the wrapper's underlying
12 sequence and |c1...cn| are integral constants of an integral type ``T`` to
13 be stored in the sequence, the wrapper provides us with the following
18 ``seq_c<T``,\ |c1...cn|\ ``>``
20 If ``seq`` is a |Variadic Sequence|, *numbered* wrapper forms are
25 ``seq``\ *n*\ ``_c<T``,\ |c1...cn|\ ``>``
29 Expression requirements
30 -----------------------
32 |In the following table...| ``seq`` is a placeholder token for the
33 |Integral Sequence Wrapper|'s underlying sequence's name.
36 .. |seq_c| replace:: ``seq_c<T``,\ |c1...cn|
37 .. |seqn_c| replace:: ``seq``\ *n*\ ``_c<T``,\ |c1...cn|
40 +-------------------------------+-----------------------+---------------------------+
41 | Expression | Type | Complexity |
42 +===============================+=======================+===========================+
43 | |seq_c|\ ``>`` | |Forward Sequence| | Amortized constant time. |
44 +-------------------------------+-----------------------+---------------------------+
45 | |seq_c|\ ``>::type`` | |Forward Sequence| | Amortized constant time. |
46 +-------------------------------+-----------------------+---------------------------+
47 | |seq_c|\ ``>::value_type`` | An integral type | Amortized constant time. |
48 +-------------------------------+-----------------------+---------------------------+
49 | |seqn_c|\ ``>`` | |Forward Sequence| | Amortized constant time. |
50 +-------------------------------+-----------------------+---------------------------+
51 | |seqn_c|\ ``>::type`` | |Forward Sequence| | Amortized constant time. |
52 +-------------------------------+-----------------------+---------------------------+
53 | |seqn_c|\ ``>::value_type`` | An integral type | Amortized constant time. |
54 +-------------------------------+-----------------------+---------------------------+
63 typedef seq_c<T,\ |c1...cn|> s;
64 typedef seq\ *n*\ _c<T,\ |c1...cn|> s;
67 ``s`` is a sequence ``seq`` of integral constant wrappers ``integral_c<T,``\ |c1|\ ``>``,
68 ``integral_c<T,``\ |c2|\ ``>``, ... ``integral_c<T,``\ |cn|\ ``>``.
71 ``size<s>::value == n``.
73 .. .. parsed-literal::
75 BOOST_MPL_ASSERT_RELATION(( at_c<v,0>::type::value,==,\ |c1| ));
76 BOOST_MPL_ASSERT_RELATION(( at_c<v,1>::type::value,==,\ |c2| ));
78 BOOST_MPL_ASSERT_RELATION(( at_c<v,\ *n*>::type::value,==,\ |cn| ));
81 .. ..........................................................................
85 typedef seq_c<T,\ |c1...cn|>::type s;
86 typedef seq\ *n*\ _c<T,\ |c1...cn|>::type s;
90 ``seq``\ *n*\ ``<``\ ``integral_c<T,``\ |c1|\ ``>``,\ ``integral_c<T,``\ |c2|\ ``>``,
91 ... ``integral_c<T,``\ |cn|\ ``>`` ``>``.
94 .. ..........................................................................
98 typedef seq_c<T,\ |c1...cn|>::value_type t;
99 typedef seq\ *n*\ _c<T,\ |c1...cn|>::value_type t;
102 ``is_same<t,T>::value == true``.
115 |Sequences|, |Variadic Sequence|, |Integral Constant|
118 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
119 Distributed under the Boost Software License, Version 1.0. (See accompanying
120 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)