| 1 |
#ifndef _INTEGRAL_CONSTANT_H_ |
| 2 |
#define _INTEGRAL_CONSTANT_H_ |
| 3 |
|
| 4 |
template <class T, T v> |
| 5 |
struct integral_constant { |
| 6 |
static constexpr T value = v; |
| 7 |
typedef T value_type; |
| 8 |
typedef integral_constant type; // using injected-class-name |
| 9 |
constexpr operator value_type() const noexcept { return value; } |
| 10 |
}; |
| 11 |
|
| 12 |
using false_type = integral_constant<bool, false>; |
| 13 |
using true_type = integral_constant<bool, true>; |
| 14 |
|
| 15 |
template <class T, class U> |
| 16 |
struct is_same : false_type {}; |
| 17 |
|
| 18 |
template <class T> |
| 19 |
struct is_same<T, T> : true_type {}; |
| 20 |
|
| 21 |
#endif |