Chris@16
|
1
|
Chris@16
|
2 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
|
Chris@16
|
3
|
Chris@16
|
4 // Copyright Aleksey Gurtovoy 2000-2004
|
Chris@16
|
5 //
|
Chris@16
|
6 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
7 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
8 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
9 //
|
Chris@16
|
10 // See http://www.boost.org/libs/mpl for documentation.
|
Chris@16
|
11
|
Chris@101
|
12 // $Id$
|
Chris@101
|
13 // $Date$
|
Chris@101
|
14 // $Revision$
|
Chris@16
|
15
|
Chris@16
|
16 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
Chris@16
|
17 # include <boost/mpl/integral_c.hpp>
|
Chris@16
|
18 # include <boost/mpl/aux_/largest_int.hpp>
|
Chris@16
|
19 # include <boost/mpl/aux_/value_wknd.hpp>
|
Chris@16
|
20 #endif
|
Chris@16
|
21
|
Chris@16
|
22 #if !defined(AUX778076_OP_PREFIX)
|
Chris@16
|
23 # define AUX778076_OP_PREFIX AUX778076_OP_NAME
|
Chris@16
|
24 #endif
|
Chris@16
|
25
|
Chris@16
|
26 #include <boost/mpl/aux_/numeric_op.hpp>
|
Chris@16
|
27 #include <boost/mpl/aux_/config/static_constant.hpp>
|
Chris@16
|
28 #include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
Chris@16
|
29
|
Chris@16
|
30 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
Chris@16
|
31 && !defined(BOOST_MPL_PREPROCESSING_MODE)
|
Chris@16
|
32
|
Chris@16
|
33 # define BOOST_MPL_PREPROCESSED_HEADER AUX778076_OP_PREFIX.hpp
|
Chris@16
|
34 # include <boost/mpl/aux_/include_preprocessed.hpp>
|
Chris@16
|
35
|
Chris@16
|
36 #else
|
Chris@16
|
37
|
Chris@16
|
38 # include <boost/mpl/aux_/config/workaround.hpp>
|
Chris@16
|
39 # include <boost/preprocessor/cat.hpp>
|
Chris@16
|
40
|
Chris@16
|
41
|
Chris@16
|
42 namespace boost { namespace mpl {
|
Chris@16
|
43
|
Chris@16
|
44 #if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC)
|
Chris@16
|
45 namespace aux {
|
Chris@16
|
46 template< typename T, T n1, T n2 >
|
Chris@16
|
47 struct BOOST_PP_CAT(AUX778076_OP_PREFIX,_wknd)
|
Chris@16
|
48 {
|
Chris@16
|
49 BOOST_STATIC_CONSTANT(T, value = (n1 AUX778076_OP_TOKEN n2));
|
Chris@16
|
50 typedef integral_c<T,value> type;
|
Chris@16
|
51 };
|
Chris@16
|
52 }
|
Chris@16
|
53 #endif
|
Chris@16
|
54
|
Chris@16
|
55 template<>
|
Chris@16
|
56 struct AUX778076_OP_IMPL_NAME<integral_c_tag,integral_c_tag>
|
Chris@16
|
57 {
|
Chris@16
|
58 template< typename N1, typename N2 > struct apply
|
Chris@16
|
59 #if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC)
|
Chris@16
|
60 : integral_c<
|
Chris@16
|
61 typename aux::largest_int<
|
Chris@16
|
62 typename N1::value_type
|
Chris@16
|
63 , typename N2::value_type
|
Chris@16
|
64 >::type
|
Chris@16
|
65 , ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
|
Chris@16
|
66 AUX778076_OP_TOKEN BOOST_MPL_AUX_VALUE_WKND(N2)::value
|
Chris@16
|
67 )
|
Chris@16
|
68 >
|
Chris@16
|
69 #else
|
Chris@16
|
70 : aux::BOOST_PP_CAT(AUX778076_OP_PREFIX,_wknd)<
|
Chris@16
|
71 typename aux::largest_int<
|
Chris@16
|
72 typename N1::value_type
|
Chris@16
|
73 , typename N2::value_type
|
Chris@16
|
74 >::type
|
Chris@16
|
75 , N1::value
|
Chris@16
|
76 , N2::value
|
Chris@16
|
77 >::type
|
Chris@16
|
78 #endif
|
Chris@16
|
79 {
|
Chris@16
|
80 };
|
Chris@16
|
81 };
|
Chris@16
|
82
|
Chris@16
|
83 }}
|
Chris@16
|
84
|
Chris@16
|
85 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
Chris@16
|
86
|
Chris@16
|
87 #undef AUX778076_OP_TAG_NAME
|
Chris@16
|
88 #undef AUX778076_OP_IMPL_NAME
|
Chris@16
|
89 #undef AUX778076_OP_ARITY
|
Chris@16
|
90 #undef AUX778076_OP_PREFIX
|
Chris@16
|
91 #undef AUX778076_OP_NAME
|
Chris@16
|
92 #undef AUX778076_OP_TOKEN
|