numeric_cast_traits.hpp 983 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. //! Copyright (c) 2011
  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. #ifndef BOOST_NUMERIC_CAST_TRAITS_HPP
  10. #define BOOST_NUMERIC_CAST_TRAITS_HPP
  11. #include <boost/numeric/conversion/converter_policies.hpp>
  12. namespace boost { namespace numeric {
  13. template <typename Target, typename Source, typename EnableIf = void>
  14. struct numeric_cast_traits
  15. {
  16. typedef def_overflow_handler overflow_policy;
  17. typedef UseInternalRangeChecker range_checking_policy;
  18. typedef Trunc<Source> rounding_policy;
  19. };
  20. }}//namespace boost::numeric;
  21. #if !defined( BOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS )
  22. #include <boost/cstdint.hpp>
  23. #include <boost/numeric/conversion/detail/numeric_cast_traits.hpp>
  24. #endif//!defined BOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS
  25. #endif//BOOST_NUMERIC_CAST_TRAITS_HPP