Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 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: arithmetic_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ |
| 13 | // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $ |
| 14 | // $Revision: 49267 $ |
| 15 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 16 | #if !defined(NDNBOOST_MPL_PREPROCESSING_MODE) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 17 | # include <ndnboost/mpl/integral_c.hpp> |
| 18 | # include <ndnboost/mpl/aux_/largest_int.hpp> |
| 19 | # include <ndnboost/mpl/aux_/value_wknd.hpp> |
| 20 | #endif |
| 21 | |
| 22 | #if !defined(AUX778076_OP_PREFIX) |
| 23 | # define AUX778076_OP_PREFIX AUX778076_OP_NAME |
| 24 | #endif |
| 25 | |
| 26 | #include <ndnboost/mpl/aux_/numeric_op.hpp> |
| 27 | #include <ndnboost/mpl/aux_/config/static_constant.hpp> |
| 28 | #include <ndnboost/mpl/aux_/config/use_preprocessed.hpp> |
| 29 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 30 | #if !defined(NDNBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ |
| 31 | && !defined(NDNBOOST_MPL_PREPROCESSING_MODE) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 32 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 33 | # define NDNBOOST_MPL_PREPROCESSED_HEADER AUX778076_OP_PREFIX.hpp |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 34 | # include <ndnboost/mpl/aux_/include_preprocessed.hpp> |
| 35 | |
| 36 | #else |
| 37 | |
| 38 | # include <ndnboost/mpl/aux_/config/workaround.hpp> |
| 39 | # include <ndnboost/preprocessor/cat.hpp> |
| 40 | |
| 41 | |
| 42 | namespace ndnboost { namespace mpl { |
| 43 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 44 | #if defined(NDNBOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 45 | namespace aux { |
| 46 | template< typename T, T n1, T n2 > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 47 | struct NDNBOOST_PP_CAT(AUX778076_OP_PREFIX,_wknd) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 48 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 49 | NDNBOOST_STATIC_CONSTANT(T, value = (n1 AUX778076_OP_TOKEN n2)); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 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 N1, typename N2 > struct apply |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 59 | #if !defined(NDNBOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 60 | : integral_c< |
| 61 | typename aux::largest_int< |
| 62 | typename N1::value_type |
| 63 | , typename N2::value_type |
| 64 | >::type |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 65 | , ( NDNBOOST_MPL_AUX_VALUE_WKND(N1)::value |
| 66 | AUX778076_OP_TOKEN NDNBOOST_MPL_AUX_VALUE_WKND(N2)::value |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 67 | ) |
| 68 | > |
| 69 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 70 | : aux::NDNBOOST_PP_CAT(AUX778076_OP_PREFIX,_wknd)< |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 71 | typename aux::largest_int< |
| 72 | typename N1::value_type |
| 73 | , typename N2::value_type |
| 74 | >::type |
| 75 | , N1::value |
| 76 | , N2::value |
| 77 | >::type |
| 78 | #endif |
| 79 | { |
| 80 | }; |
| 81 | }; |
| 82 | |
| 83 | }} |
| 84 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 85 | #endif // NDNBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 86 | |
| 87 | #undef AUX778076_OP_TAG_NAME |
| 88 | #undef AUX778076_OP_IMPL_NAME |
| 89 | #undef AUX778076_OP_ARITY |
| 90 | #undef AUX778076_OP_PREFIX |
| 91 | #undef AUX778076_OP_NAME |
| 92 | #undef AUX778076_OP_TOKEN |