BVB Source Codes

mars Show numeric_cast_traits.hpp Source code

Return Download mars: download numeric_cast_traits.hpp Source code - Download mars Source code - Type:.hpp
  1. //
  2. //! Copyright (c) 2011-2012
  3. //! Brandon Kohn
  4. //
  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)
  8. //
  9.  
  10. #if !defined(BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES)
  11.  
  12.     #include <boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp>
  13.        
  14.         #if !defined(BOOST_NO_LONG_LONG)
  15.         #include <boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp>
  16.         #endif
  17.        
  18. #else
  19. #if !BOOST_PP_IS_ITERATING
  20.  
  21.     #include <boost/preprocessor/seq/elem.hpp>
  22.     #include <boost/preprocessor/seq/size.hpp>
  23.     #include <boost/preprocessor/iteration/iterate.hpp>
  24.    
  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")
  27.     #endif
  28. //
  29. //! Copyright (c) 2011-2012
  30. //! Brandon Kohn
  31. //
  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)
  35. //
  36.     #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
  37.         #pragma wave option(preserve: 1)
  38.     #endif
  39.        
  40.         //! These are the assumed common built in fundamental types (not typedefs/macros.)
  41.         #define BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() \
  42.         (char)                                            \
  43.         (signed char)                                     \
  44.         (unsigned char)                                   \
  45.         (short)                                           \
  46.         (unsigned short)                                  \
  47.         (int)                                             \
  48.         (unsigned int)                                    \
  49.         (long)                                            \
  50.         (unsigned long)                                   \
  51.         (float)                                           \
  52.         (double)                                          \
  53.         (long double)                                     \
  54.     /***/
  55.        
  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()
  58.  
  59. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace numeric {
  60.  
  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()    
  63.  
  64. }}//namespace mars_boost::numeric;
  65.  
  66.     #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
  67.         #pragma wave option(output: null)
  68.     #endif  
  69.        
  70.         #if ( defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) ) || !defined(BOOST_NO_LONG_LONG)
  71.        
  72.             #undef BOOST_NUMERIC_CONVERSION_SEQ_A
  73.             #undef BOOST_NUMERIC_CONVERSION_SEQ_B
  74.  
  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")
  77.         #endif
  78.  
  79. //
  80. //! Copyright (c) 2011-2012
  81. //! Brandon Kohn
  82. //
  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)
  86. //
  87.         #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
  88.             #pragma wave option(preserve: 1)
  89.         #endif
  90.  
  91. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace numeric {
  92.  
  93.     #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()(mars_boost::long_long_type)(mars_boost::ulong_long_type)
  94.         #define BOOST_NUMERIC_CONVERSION_SEQ_B() (mars_boost::long_long_type)(mars_boost::ulong_long_type)
  95.    
  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()    
  98.  
  99. }}//namespace mars_boost::numeric;
  100.  
  101.         #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
  102.             #pragma wave option(output: null)
  103.         #endif  
  104.        
  105.         #endif
  106.                
  107.     #undef BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES
  108.         #undef BOOST_NUMERIC_CONVERSION_SEQ_A
  109.         #undef BOOST_NUMERIC_CONVERSION_SEQ_B
  110.    
  111. #elif BOOST_PP_ITERATION_DEPTH() == 1
  112.  
  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()
  115.  
  116. #elif BOOST_PP_ITERATION_DEPTH() == 2
  117.  
  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)
  121.  
  122.     template <>
  123.     struct numeric_cast_traits
  124.         <
  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())
  127.         >
  128.     {
  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;
  132.     };    
  133.  
  134.     #undef BOOST_NUMERIC_CONVERSION_A
  135.     #undef BOOST_NUMERIC_CONVERSION_B
  136.  
  137. #endif//! Depth 2.
  138. #endif// BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES
  139.  
downloadnumeric_cast_traits.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top