1 /* ///////////////////////////////////////////////////////////////////////
2 * File: is_arithmetic.h
7 * Brief: is_arithmetic traits
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_TYPE_TRAITS_IS_ARITHMETIC_H
13 #define EXTL_TYPE_TRAITS_IS_ARITHMETIC_H
15 /* ///////////////////////////////////////////////////////////////////////
19 #include "logical_op.h"
23 /* ///////////////////////////////////////////////////////////////////////
26 #define EXTL_MUST_BE_ARITHMETIC(type) EXTL_MUST_BE_(is_arithmetic, type)
27 #define EXTL_MUST_BE_CV_ARITHMETIC(type) EXTL_MUST_BE_CV_(is_arithmetic, type)
29 /* ///////////////////////////////////////////////////////////////////////
34 #ifdef EXTL_TYPE_TRAITS_SUPPORT
36 template< typename_param_k T
>
37 struct is_arithmetic_impl
39 EXTL_STATIC_MEMBER_CONST(e_bool_t
, value
= (op_or
< is_int
<T
>::value
41 , EXTL_OP_OR_DEF_ARG_2
45 EXTL_BOOL_TRAIT_DEF_1(is_arithmetic
, is_arithmetic_impl
<T
>::value
)
47 /* ///////////////////////////////////////////////////////////////////////
50 # ifdef EXTL_TYPE_TRAITS_TEST_ENABLE
51 # include "unit_test/is_arithmetic_test.h"
55 /* ///////////////////////////////////////////////////////////////////////
60 /* //////////////////////////////////////////////////////////////////// */
61 #endif /* EXTL_TYPE_TRAITS_IS_ARITHMETIC_H */
62 /* //////////////////////////////////////////////////////////////////// */