You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 lines
1.5 KiB

#pragma once
namespace ft {
// is_integral:
template < class T, T val > struct integral_constant {
typedef integral_constant< T, val > type;
typedef T value_type;
static const T value = val;
operator T() const;
};
typedef integral_constant< bool, true > true_type;
typedef integral_constant< bool, false > false_type;
template < class T > struct is_integral : public false_type {};
template < class T > struct is_integral< const T > : public false_type {};
template <> struct is_integral< bool > : public true_type {};
template <> struct is_integral< double > : public true_type {};
template <> struct is_integral< char > : public true_type {};
template <> struct is_integral< short > : public true_type {};
template <> struct is_integral< int > : public true_type {};
template <> struct is_integral< long > : public true_type {};
template <> struct is_integral< long long > : public true_type {};
template <> struct is_integral< unsigned char > : public true_type {};
template <> struct is_integral< unsigned short > : public true_type {};
template <> struct is_integral< unsigned int > : public true_type {};
template <> struct is_integral< unsigned long > : public true_type {};
template <> struct is_integral< unsigned long long > : public true_type {};
// enable_if:
template < bool B, class T = void > struct enable_if {};
template < class T > struct enable_if< true, T > {
typedef T type;
};
} // namespace ft