-
Notifications
You must be signed in to change notification settings - Fork 0
/
P448.FundamentalTypes.cpp
38 lines (32 loc) · 1.01 KB
/
P448.FundamentalTypes.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <type_traits>
template<typename T>
struct IsFundamentalType : public std::false_type {};
template<typename T>
constexpr bool IsFundamentalType_v = IsFundamentalType<T>::value;
#define MK_FUNDAMENTAL_TYPE(T)\
template<>\
struct IsFundamentalType<T> : public std::true_type {}
MK_FUNDAMENTAL_TYPE(bool);
MK_FUNDAMENTAL_TYPE(char);
MK_FUNDAMENTAL_TYPE(signed char);
MK_FUNDAMENTAL_TYPE(unsigned char);
MK_FUNDAMENTAL_TYPE(wchar_t);
MK_FUNDAMENTAL_TYPE(char16_t);
MK_FUNDAMENTAL_TYPE(char32_t);
MK_FUNDAMENTAL_TYPE(signed short);
MK_FUNDAMENTAL_TYPE(unsigned short);
MK_FUNDAMENTAL_TYPE(signed int);
MK_FUNDAMENTAL_TYPE(unsigned int);
MK_FUNDAMENTAL_TYPE(signed long);
MK_FUNDAMENTAL_TYPE(unsigned long);
MK_FUNDAMENTAL_TYPE(signed long long);
MK_FUNDAMENTAL_TYPE(unsigned long long);
MK_FUNDAMENTAL_TYPE(float);
MK_FUNDAMENTAL_TYPE(double);
MK_FUNDAMENTAL_TYPE(long double);
MK_FUNDAMENTAL_TYPE(std::nullptr_t);
int main(int argc, char const *argv[])
{
static_assert(IsFundamentalType_v<char>);
return 0;
}