-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtype_traits.hpp
More file actions
38 lines (29 loc) · 1.56 KB
/
type_traits.hpp
File metadata and controls
38 lines (29 loc) · 1.56 KB
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
#ifndef __TYPE_TRAITS_HPP__
# define __TYPE_TRAITS_HPP__
namespace ft {
template<bool B, class T = void>
struct enable_if {};
template<class T>
struct enable_if<true, T> { typedef T type; };
template<typename T> struct is_integral { static const bool value = false; };
template<> struct is_integral<bool>{ static const bool value = true; };
template<> struct is_integral<char>{ static const bool value = true; };
template<> struct is_integral<char16_t>{ static const bool value = true; };
template<> struct is_integral<char32_t>{ static const bool value = true; };
template<> struct is_integral<wchar_t>{ static const bool value = true; };
template<> struct is_integral<signed char>{ static const bool value = true; };
template<> struct is_integral<short int>{ static const bool value = true; };
template<> struct is_integral<int>{ static const bool value = true; };
template<> struct is_integral<long int>{ static const bool value = true; };
template<> struct is_integral<long long int>{ static const bool value = true; };
template<> struct is_integral<unsigned char>{ static const bool value = true; };
template<> struct is_integral<unsigned short int>{ static const bool value = true; };
template<> struct is_integral<unsigned int>{ static const bool value = true; };
template<> struct is_integral<unsigned long int>{ static const bool value = true; };
template<> struct is_integral<unsigned long long int>{ static const bool value = true; };
template <typename VAL>
struct delConst {typedef VAL type;};
template <typename VAL>
struct delConst<const VAL>{typedef VAL type;};
}
#endif