• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. Data Types/Numeric//long_ |30
2
3long\_
4======
5
6Synopsis
7--------
8
9.. parsed-literal::
10
11    template<
12          long N
13        >
14    struct long\_
15    {
16        // |unspecified|
17        // ...
18    };
19
20
21Description
22-----------
23
24An |Integral Constant| wrapper for ``long``.
25
26
27Header
28------
29
30.. parsed-literal::
31
32    #include <boost/mpl/long.hpp>
33
34
35Model of
36--------
37
38|Integral Constant|
39
40
41Parameters
42----------
43
44+---------------+-------------------------------+---------------------------+
45| Parameter     | Requirement                   | Description               |
46+===============+===============================+===========================+
47| ``N``         | An integral constant          | A value to wrap.          |
48+---------------+-------------------------------+---------------------------+
49
50Expression semantics
51--------------------
52
53|Semantics disclaimer...| |Integral Constant|.
54
55For arbitrary integral constant ``n``:
56
57+-------------------+-----------------------------------------------------------+
58| Expression        | Semantics                                                 |
59+===================+===========================================================+
60| ``long_<c>``      | An |Integral Constant| ``x`` such that ``x::value == c``  |
61|                   | and ``x::value_type`` is identical to ``long``.           |
62+-------------------+-----------------------------------------------------------+
63
64
65Example
66-------
67
68.. parsed-literal::
69
70    typedef long_<8> eight;
71
72    BOOST_MPL_ASSERT(( is_same< eight::value_type, long > ));
73    BOOST_MPL_ASSERT(( is_same< eight::type, eight > ));
74    BOOST_MPL_ASSERT(( is_same< next< eight >::type, long_<9> > ));
75    BOOST_MPL_ASSERT(( is_same< prior< eight >::type, long_<7> > ));
76    BOOST_MPL_ASSERT_RELATION( (eight::value), ==, 8 );
77    assert( eight() == 8 );
78
79
80See also
81--------
82
83|Data Types|, |Integral Constant|, |int_|, |size_t|, |integral_c|
84
85
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)
89