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