remove \r
[extl.git] / extl / type / traits / is_scalar.h
blobd67abd72ec68c64f744bf6171c67055816b50fb5
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: is_scalar.h
4 * Created: 08.02.07
5 * Updated: 08.07.09
7 * Brief: is_scalar traits
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_TYPE_TRAITS_IS_SCALAR_H
13 #define EXTL_TYPE_TRAITS_IS_SCALAR_H
15 #ifndef EXTL_TYPE_TRAITS_IS_SCALAR_SUPPORT
16 # error extl::is_scalar is not supported by current compiler.
17 #endif
19 /* ///////////////////////////////////////////////////////////////////////
20 * Includes
22 #include "prefix.h"
23 #include "is_arithmetic.h"
24 #include "logical_op.h"
26 #ifdef EXTL_TYPE_TRAITS_IS_PTR_SUPPORT
27 # include "is_ptr.h"
28 #endif
30 #ifdef EXTL_TYPE_TRAITS_IS_MEM_PTR_SUPPORT
31 # include "is_mem_ptr.h"
32 #endif
34 #ifdef EXTL_TYPE_TRAITS_IS_ENUM_SUPPORT
35 # include "is_enum.h"
36 #endif
38 /* ///////////////////////////////////////////////////////////////////////
39 * Macros
41 #define EXTL_MUST_BE_SCALAR(type) EXTL_MUST_BE_(is_scalar, type)
42 #define EXTL_MUST_BE_CV_SCALAR(type) EXTL_MUST_BE_CV_(is_scalar, type)
44 #define EXTL_MUST_NOT_BE_SCALAR(type) EXTL_MUST_NOT_BE_(is_scalar, type)
45 #define EXTL_MUST_NOT_BE_CV_SCALAR(type) EXTL_MUST_NOT_BE_CV_(is_scalar, type)
46 /* ///////////////////////////////////////////////////////////////////////
47 * ::extl namespace
49 EXTL_BEGIN_NAMESPACE
51 #ifdef EXTL_TYPE_TRAITS_SUPPORT
53 #ifdef EXTL_TYPE_TRAITS_IS_ENUM_SUPPORT
54 EXTL_BOOL_TRAIT_DEF_1(is_scalar, (op_or < (is_arithmetic<T>::value)
55 , (is_ptr<T>::value)
56 , (is_mem_ptr<T>::value)
57 , (is_enum<T>::value)
58 >::value))
59 #else
60 EXTL_BOOL_TRAIT_DEF_1(is_scalar, (op_or < (is_arithmetic<T>::value)
61 , (is_ptr<T>::value)
62 , (is_mem_ptr<T>::value)
63 >::value))
64 #endif
66 EXTL_BOOL_TRAIT_SPEC_1(is_scalar, void, e_false_v)
67 # ifdef EXTL_CV_VOID_SPEC_SUPPORT
68 EXTL_BOOL_TRAIT_SPEC_1(is_scalar, void const, e_false_v)
69 EXTL_BOOL_TRAIT_SPEC_1(is_scalar, void volatile, e_false_v)
70 EXTL_BOOL_TRAIT_SPEC_1(is_scalar, void const volatile, e_false_v)
71 # endif
73 /* ///////////////////////////////////////////////////////////////////////
74 * Unit-testing
76 # ifdef EXTL_TYPE_TRAITS_TEST_ENABLE
77 # include "unit_test/is_scalar_test.h"
78 # endif
79 #endif /* EXTL_TYPE_TRAITS_SUPPORT */
81 /* ///////////////////////////////////////////////////////////////////////
82 * ::extl namespace
84 EXTL_END_NAMESPACE
86 /* //////////////////////////////////////////////////////////////////// */
87 #endif /* EXTL_TYPE_TRAITS_IS_SCALAR_H */
88 /* //////////////////////////////////////////////////////////////////// */