]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpl/doc/src/refmanual/integral_c.rst
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / mpl / doc / src / refmanual / integral_c.rst
1 .. Data Types/Numeric//integral_c |50
2
3 integral_c
4 ==========
5
6 Synopsis
7 --------
8
9 .. parsed-literal::
10
11 template<
12 typename T, T N
13 >
14 struct integral_c
15 {
16 // |unspecified|
17 // ...
18 };
19
20
21 Description
22 -----------
23
24 A generic |Integral Constant| wrapper.
25
26
27 Header
28 ------
29
30 .. parsed-literal::
31
32 #include <boost/mpl/integral_c.hpp>
33
34
35 Model of
36 --------
37
38 |Integral Constant|
39
40
41 Parameters
42 ----------
43
44 +---------------+-------------------------------+---------------------------+
45 | Parameter | Requirement | Description |
46 +===============+===============================+===========================+
47 | ``T`` | An integral type | Wrapper's value type. |
48 +---------------+-------------------------------+---------------------------+
49 | ``N`` | An integral constant | A value to wrap. |
50 +---------------+-------------------------------+---------------------------+
51
52
53 Expression semantics
54 --------------------
55
56 |Semantics disclaimer...| |Integral Constant|.
57
58 For arbitrary integral type ``t`` and integral constant ``n``:
59
60 +-----------------------+-----------------------------------------------------------+
61 | Expression | Semantics |
62 +=======================+===========================================================+
63 | ``integral_c<t,c>`` | An |Integral Constant| ``x`` such that ``x::value == c`` |
64 | | and ``x::value_type`` is identical to ``t``. |
65 +-----------------------+-----------------------------------------------------------+
66
67
68 Example
69 -------
70
71 .. parsed-literal::
72
73 typedef integral_c<short,8> eight;
74
75 BOOST_MPL_ASSERT(( is_same< eight::value_type, short > ));
76 BOOST_MPL_ASSERT(( is_same< eight::type, eight > ));
77 BOOST_MPL_ASSERT(( is_same< next< eight >::type, integral_c<short,9> > ));
78 BOOST_MPL_ASSERT(( is_same< prior< eight >::type, integral_c<short,7> > ));
79 BOOST_MPL_ASSERT_RELATION( (eight::value), ==, 8 );
80 assert( eight() == 8 );
81
82
83 See also
84 --------
85
86 |Data Types|, |Integral Constant|, |bool_|, |int_|, |long_|, |size_t|
87
88
89 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
90 Distributed under the Boost Software License, Version 1.0. (See accompanying
91 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)