remove \r
[extl.git] / extl / type / traits / is_arithmetic.h
blob614283a71b80411ef1639bab8f5ea02cafead33c
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: is_arithmetic.h
4 * Created: 08.02.17
5 * Updated: 08.07.09
7 * Brief: is_arithmetic traits
9 * [<Home>]
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 /* ///////////////////////////////////////////////////////////////////////
16 * Includes
18 #include "prefix.h"
19 #include "logical_op.h"
20 #include "is_float.h"
21 #include "is_int.h"
23 /* ///////////////////////////////////////////////////////////////////////
24 * Macros
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 /* ///////////////////////////////////////////////////////////////////////
30 * ::extl namespace
32 EXTL_BEGIN_NAMESPACE
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
40 , is_float<T>::value
41 , EXTL_OP_OR_DEF_ARG_2
42 >::value));
45 EXTL_BOOL_TRAIT_DEF_1(is_arithmetic, is_arithmetic_impl<T>::value)
47 /* ///////////////////////////////////////////////////////////////////////
48 * Unit-testing
50 # ifdef EXTL_TYPE_TRAITS_TEST_ENABLE
51 # include "unit_test/is_arithmetic_test.h"
52 # endif
53 #endif
55 /* ///////////////////////////////////////////////////////////////////////
56 * ::extl namespace
58 EXTL_END_NAMESPACE
60 /* //////////////////////////////////////////////////////////////////// */
61 #endif /* EXTL_TYPE_TRAITS_IS_ARITHMETIC_H */
62 /* //////////////////////////////////////////////////////////////////// */