forked from CUST-ACM/CUSTL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
type_traits.h
73 lines (67 loc) · 1.68 KB
/
type_traits.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* file: type_traits.h
* date: 2018/04/30
* author: axp (Xiao Peng)
*/
#ifndef _CUSTL_TYPE_TRAITS_H
#define _CUSTL_TYPE_TRAITS_H
namespace custl {
struct __true_type {};
struct __false_type {};
template <typename T>
struct type_traits {
typedef __false_type is_trivially_constructible;
};
template<>
struct type_traits<char> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<signed char> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<unsigned char> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<short> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<unsigned short> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<int> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<unsigned int> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<long long> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<unsigned long long> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<float> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<double> {
typedef __true_type is_trivially_constructible;
};
template<>
struct type_traits<long double> {
typedef __true_type is_trivially_constructible;
};
template <typename T>
struct type_traits<T*> {
typedef __true_type is_trivially_constructible;
};
}; // namespace custl
#endif // _CUSTL_TYPE_TRAITS_H