Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 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 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 9 | #ifndef NDNBOOST_NUMERIC_CAST_TRAITS_HPP |
| 10 | #define NDNBOOST_NUMERIC_CAST_TRAITS_HPP |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 11 | |
| 12 | #include <ndnboost/numeric/conversion/converter_policies.hpp> |
| 13 | |
| 14 | namespace ndnboost { namespace numeric { |
| 15 | |
| 16 | template <typename Target, typename Source, typename EnableIf = void> |
| 17 | struct numeric_cast_traits |
| 18 | { |
| 19 | typedef def_overflow_handler overflow_policy; |
| 20 | typedef UseInternalRangeChecker range_checking_policy; |
| 21 | typedef Trunc<Source> rounding_policy; |
| 22 | }; |
| 23 | |
| 24 | }}//namespace ndnboost::numeric; |
| 25 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 26 | #if !defined( NDNBOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS ) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 27 | #include <ndnboost/cstdint.hpp> |
| 28 | #include <ndnboost/numeric/conversion/detail/numeric_cast_traits.hpp> |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 29 | #endif//!defined NDNBOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 30 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 31 | #endif//NDNBOOST_NUMERIC_CAST_TRAITS_HPP |