Chris@16: // Chris@16: //! Copyright (c) 2011-2012 Chris@16: //! Brandon Kohn Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: Chris@16: #if !defined(BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES) Chris@16: Chris@16: #include Chris@16: Chris@16: #if !defined(BOOST_NO_LONG_LONG) Chris@16: #include Chris@16: #endif Chris@16: Chris@16: #else Chris@16: #if !BOOST_PP_IS_ITERATING Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_common.hpp") Chris@16: #endif Chris@16: // Chris@16: //! Copyright (c) 2011-2012 Chris@16: //! Brandon Kohn Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 1) Chris@16: #endif Chris@16: Chris@16: //! These are the assumed common built in fundamental types (not typedefs/macros.) Chris@16: #define BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() \ Chris@16: (char) \ Chris@16: (signed char) \ Chris@16: (unsigned char) \ Chris@16: (short) \ Chris@16: (unsigned short) \ Chris@16: (int) \ Chris@16: (unsigned int) \ Chris@16: (long) \ Chris@16: (unsigned long) \ Chris@16: (float) \ Chris@16: (double) \ Chris@16: (long double) \ Chris@16: /***/ Chris@16: Chris@16: #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() Chris@16: #define BOOST_NUMERIC_CONVERSION_SEQ_B() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() Chris@16: Chris@16: namespace boost { namespace numeric { Chris@16: Chris@16: #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), )) Chris@16: #include BOOST_PP_ITERATE() Chris@16: Chris@16: }}//namespace boost::numeric; Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(output: null) Chris@16: #endif Chris@16: Chris@16: #if ( defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) ) || !defined(BOOST_NO_LONG_LONG) Chris@16: Chris@16: #undef BOOST_NUMERIC_CONVERSION_SEQ_A Chris@16: #undef BOOST_NUMERIC_CONVERSION_SEQ_B Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_long_long.hpp") Chris@16: #endif Chris@16: Chris@16: // Chris@16: //! Copyright (c) 2011-2012 Chris@16: //! Brandon Kohn Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 1) Chris@16: #endif Chris@16: Chris@16: namespace boost { namespace numeric { Chris@16: Chris@16: #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()(boost::long_long_type)(boost::ulong_long_type) Chris@16: #define BOOST_NUMERIC_CONVERSION_SEQ_B() (boost::long_long_type)(boost::ulong_long_type) Chris@16: Chris@16: #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), )) Chris@16: #include BOOST_PP_ITERATE() Chris@16: Chris@16: }}//namespace boost::numeric; Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(output: null) Chris@16: #endif Chris@16: Chris@16: #endif Chris@16: Chris@16: #undef BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES Chris@16: #undef BOOST_NUMERIC_CONVERSION_SEQ_A Chris@16: #undef BOOST_NUMERIC_CONVERSION_SEQ_B Chris@16: Chris@16: #elif BOOST_PP_ITERATION_DEPTH() == 1 Chris@16: Chris@16: #define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_B())), )) Chris@16: #include BOOST_PP_ITERATE() Chris@16: Chris@16: #elif BOOST_PP_ITERATION_DEPTH() == 2 Chris@16: Chris@16: //! Generate default traits for the specified source and target. Chris@16: #define BOOST_NUMERIC_CONVERSION_A BOOST_PP_FRAME_ITERATION(1) Chris@16: #define BOOST_NUMERIC_CONVERSION_B BOOST_PP_FRAME_ITERATION(2) Chris@16: Chris@16: template <> Chris@16: struct numeric_cast_traits Chris@16: < Chris@16: BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_A, BOOST_NUMERIC_CONVERSION_SEQ_A()) Chris@16: , BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B()) Chris@16: > Chris@16: { Chris@16: typedef def_overflow_handler overflow_policy; Chris@16: typedef UseInternalRangeChecker range_checking_policy; Chris@16: typedef Trunc rounding_policy; Chris@16: }; Chris@16: Chris@16: #undef BOOST_NUMERIC_CONVERSION_A Chris@16: #undef BOOST_NUMERIC_CONVERSION_B Chris@16: Chris@16: #endif//! Depth 2. Chris@16: #endif// BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES