2 //! Copyright (c) 2011-2012
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
10 #if !defined(BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES)
12 #include <boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp>
14 #if !defined(BOOST_NO_LONG_LONG)
15 #include <boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp>
19 #if !BOOST_PP_IS_ITERATING
21 #include <boost/preprocessor/seq/elem.hpp>
22 #include <boost/preprocessor/seq/size.hpp>
23 #include <boost/preprocessor/iteration/iterate.hpp>
25 #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
26 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_common.hpp")
29 //! Copyright (c) 2011-2012
32 // Distributed under the Boost Software License, Version 1.0. (See
33 // accompanying file LICENSE_1_0.txt or copy at
34 // http://www.boost.org/LICENSE_1_0.txt)
36 #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
37 #pragma wave option(preserve: 1)
40 //! These are the assumed common built in fundamental types (not typedefs/macros.)
41 #define BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() \
56 #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()
57 #define BOOST_NUMERIC_CONVERSION_SEQ_B() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()
59 namespace boost { namespace numeric {
61 #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), <boost/numeric/conversion/detail/numeric_cast_traits.hpp>))
62 #include BOOST_PP_ITERATE()
64 }}//namespace boost::numeric;
66 #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
67 #pragma wave option(output: null)
70 #if ( defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) ) || !defined(BOOST_NO_LONG_LONG)
72 #undef BOOST_NUMERIC_CONVERSION_SEQ_A
73 #undef BOOST_NUMERIC_CONVERSION_SEQ_B
75 #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
76 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_long_long.hpp")
80 //! Copyright (c) 2011-2012
83 // Distributed under the Boost Software License, Version 1.0. (See
84 // accompanying file LICENSE_1_0.txt or copy at
85 // http://www.boost.org/LICENSE_1_0.txt)
87 #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
88 #pragma wave option(preserve: 1)
91 namespace boost { namespace numeric {
93 #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()(boost::long_long_type)(boost::ulong_long_type)
94 #define BOOST_NUMERIC_CONVERSION_SEQ_B() (boost::long_long_type)(boost::ulong_long_type)
96 #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), <boost/numeric/conversion/detail/numeric_cast_traits.hpp>))
97 #include BOOST_PP_ITERATE()
99 }}//namespace boost::numeric;
101 #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
102 #pragma wave option(output: null)
107 #undef BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES
108 #undef BOOST_NUMERIC_CONVERSION_SEQ_A
109 #undef BOOST_NUMERIC_CONVERSION_SEQ_B
111 #elif BOOST_PP_ITERATION_DEPTH() == 1
113 #define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_B())), <boost/numeric/conversion/detail/numeric_cast_traits.hpp>))
114 #include BOOST_PP_ITERATE()
116 #elif BOOST_PP_ITERATION_DEPTH() == 2
118 //! Generate default traits for the specified source and target.
119 #define BOOST_NUMERIC_CONVERSION_A BOOST_PP_FRAME_ITERATION(1)
120 #define BOOST_NUMERIC_CONVERSION_B BOOST_PP_FRAME_ITERATION(2)
123 struct numeric_cast_traits
125 BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_A, BOOST_NUMERIC_CONVERSION_SEQ_A())
126 , BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B())
129 typedef def_overflow_handler overflow_policy;
130 typedef UseInternalRangeChecker range_checking_policy;
131 typedef Trunc<BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B())> rounding_policy;
134 #undef BOOST_NUMERIC_CONVERSION_A
135 #undef BOOST_NUMERIC_CONVERSION_B
138 #endif// BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES