1 .. Data Types/Numeric//int_ |20
24 An |Integral Constant| wrapper for ``int``.
32 #include <boost/mpl/int.hpp>
44 +---------------+-------------------------------+---------------------------+
45 | Parameter | Requirement | Description |
46 +===============+===============================+===========================+
47 | ``N`` | An integral constant | A value to wrap. |
48 +---------------+-------------------------------+---------------------------+
53 |Semantics disclaimer...| |Integral Constant|.
55 For arbitrary integral constant ``n``:
57 +-------------------+-----------------------------------------------------------+
58 | Expression | Semantics |
59 +===================+===========================================================+
60 | ``int_<c>`` | An |Integral Constant| ``x`` such that ``x::value == c`` |
61 | | and ``x::value_type`` is identical to ``int``. |
62 +-------------------+-----------------------------------------------------------+
70 typedef int_<8> eight;
72 BOOST_MPL_ASSERT(( is_same< eight::value_type, int > ));
73 BOOST_MPL_ASSERT(( is_same< eight::type, eight > ));
74 BOOST_MPL_ASSERT(( is_same< next< eight >::type, int_<9> > ));
75 BOOST_MPL_ASSERT(( is_same< prior< eight >::type, int_<7> > ));
76 BOOST_MPL_ASSERT_RELATION( (eight::value), ==, 8 );
77 assert( eight() == 8 );
83 |Data Types|, |Integral Constant|, |long_|, |size_t|, |integral_c|
86 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
87 Distributed under the Boost Software License, Version 1.0. (See accompanying
88 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)