blob: 71f7014b41e621f26bbc7be3156ec561901c0cb6 [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001
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 Thompson3d613fd2013-10-15 15:39:04 -07009#ifndef NDNBOOST_TT_IS_ARITHMETIC_HPP_INCLUDED
10#define NDNBOOST_TT_IS_ARITHMETIC_HPP_INCLUDED
Jeff Thompsonf7d49942013-08-01 16:47:40 -070011
12#if !defined( __CODEGEARC__ )
Jeff Thompson2277ce52013-08-01 17:34:11 -070013#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 Thompsonf7d49942013-08-01 16:47:40 -070017#endif
18
19// should be the last #include
Jeff Thompson2277ce52013-08-01 17:34:11 -070020#include <ndnboost/type_traits/detail/bool_trait_def.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070021
22namespace ndnboost {
23
24#if !defined(__CODEGEARC__)
25namespace detail {
26
27template< typename T >
28struct is_arithmetic_impl
29{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070030 NDNBOOST_STATIC_CONSTANT(bool, value =
Jeff Thompsonf7d49942013-08-01 16:47:40 -070031 (::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 Thompson3d613fd2013-10-15 15:39:04 -070042NDNBOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,__is_arithmetic(T))
Jeff Thompsonf7d49942013-08-01 16:47:40 -070043#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070044NDNBOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,::ndnboost::detail::is_arithmetic_impl<T>::value)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070045#endif
46
47} // namespace ndnboost
48
Jeff Thompson2277ce52013-08-01 17:34:11 -070049#include <ndnboost/type_traits/detail/bool_trait_undef.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070050
Jeff Thompson3d613fd2013-10-15 15:39:04 -070051#endif // NDNBOOST_TT_IS_ARITHMETIC_HPP_INCLUDED