Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 1 | |
| 2 | // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. |
| 3 | // Use, modification and distribution are subject to the Boost Software License, |
| 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 5 | // http://www.boost.org/LICENSE_1_0.txt). |
| 6 | // |
| 7 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. |
| 8 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 9 | #ifndef NDNBOOST_TT_IS_ARITHMETIC_HPP_INCLUDED |
| 10 | #define NDNBOOST_TT_IS_ARITHMETIC_HPP_INCLUDED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 11 | |
| 12 | #if !defined( __CODEGEARC__ ) |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 13 | #include <ndnboost/type_traits/is_integral.hpp> |
| 14 | #include <ndnboost/type_traits/is_float.hpp> |
| 15 | #include <ndnboost/type_traits/detail/ice_or.hpp> |
| 16 | #include <ndnboost/config.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 17 | #endif |
| 18 | |
| 19 | // should be the last #include |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 20 | #include <ndnboost/type_traits/detail/bool_trait_def.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 21 | |
| 22 | namespace ndnboost { |
| 23 | |
| 24 | #if !defined(__CODEGEARC__) |
| 25 | namespace detail { |
| 26 | |
| 27 | template< typename T > |
| 28 | struct is_arithmetic_impl |
| 29 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 30 | NDNBOOST_STATIC_CONSTANT(bool, value = |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 31 | (::ndnboost::type_traits::ice_or< |
| 32 | ::ndnboost::is_integral<T>::value, |
| 33 | ::ndnboost::is_float<T>::value |
| 34 | >::value)); |
| 35 | }; |
| 36 | |
| 37 | } // namespace detail |
| 38 | #endif |
| 39 | |
| 40 | //* is a type T an arithmetic type described in the standard (3.9.1p8) |
| 41 | #if defined(__CODEGEARC__) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 42 | NDNBOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,__is_arithmetic(T)) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 43 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 44 | NDNBOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,::ndnboost::detail::is_arithmetic_impl<T>::value) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 45 | #endif |
| 46 | |
| 47 | } // namespace ndnboost |
| 48 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 49 | #include <ndnboost/type_traits/detail/bool_trait_undef.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 50 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 51 | #endif // NDNBOOST_TT_IS_ARITHMETIC_HPP_INCLUDED |