1 .. Data Types/Concepts//Integral Constant
9 An |Integral Constant| is a holder class for a compile-time value of an
10 integral type. Every |Integral Constant| is also a nullary |Metafunction|,
11 returning itself. An integral constant *object* is implicitly convertible to the
12 corresponding run-time value of the wrapped integral type.
14 Expression requirements
15 -----------------------
17 |In the following table...| ``n`` is a model of |Integral Constant|.
19 +-----------------------------------+---------------------------------------+---------------------------+
20 | Expression | Type | Complexity |
21 +===================================+=======================================+===========================+
22 | ``n::tag`` | ``integral_c_tag`` | Constant time. |
23 +-----------------------------------+---------------------------------------+---------------------------+
24 | ``n::value_type`` | An integral type | Constant time. |
25 +-----------------------------------+---------------------------------------+---------------------------+
26 | ``n::value`` | An integral constant expression | Constant time. |
27 +-----------------------------------+---------------------------------------+---------------------------+
28 | ``n::type`` | |Integral Constant| | Constant time. |
29 +-----------------------------------+---------------------------------------+---------------------------+
30 | ``next<n>::type`` | |Integral Constant| | Constant time. |
31 +-----------------------------------+---------------------------------------+---------------------------+
32 | ``prior<n>::type`` | |Integral Constant| | Constant time. |
33 +-----------------------------------+---------------------------------------+---------------------------+
34 | ``n::value_type const c = n()`` | | Constant time. |
35 +-----------------------------------+---------------------------------------+---------------------------+
41 +---------------------------------------+-----------------------------------------------------------+
42 | Expression | Semantics |
43 +=======================================+===========================================================+
44 | ``n::tag`` | ``n``\ 's tag type; ``n::tag::value`` is ``n``\ 's |
45 | | *conversion rank*. |
46 +---------------------------------------+-----------------------------------------------------------+
47 | ``n::value_type`` | A cv-unqualified type of ``n::value``. |
48 +---------------------------------------+-----------------------------------------------------------+
49 | ``n::value`` | The value of the wrapped integral constant. |
50 +---------------------------------------+-----------------------------------------------------------+
51 | ``n::type`` | ``is_same<n::type,n>::value == true``. |
52 +---------------------------------------+-----------------------------------------------------------+
53 | ``next<n>::type`` | An |Integral Constant| ``c`` of type ``n::value_type`` |
54 | | such that ``c::value == n::value + 1``. |
55 +---------------------------------------+-----------------------------------------------------------+
56 | ``prior<n>::type`` | An |Integral Constant| ``c`` of type ``n::value_type`` |
57 | | such that ``c::value == n::value - 1``. |
58 +---------------------------------------+-----------------------------------------------------------+
59 | ``n::value_type const c = n()`` | ``c == n::value``. |
60 +---------------------------------------+-----------------------------------------------------------+
76 |Data Types|, |Integral Sequence Wrapper|, |integral_c|
79 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
80 Distributed under the Boost Software License, Version 1.0. (See accompanying
81 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)