brintos

brintos / llvm-project-archived public Read only

0
0
Text · 528 B · 225bf44 Raw
22 lines · c
1#ifndef _INTEGRAL_CONSTANT_H_2#define _INTEGRAL_CONSTANT_H_3 4template <class T, T v>5struct integral_constant {6  static constexpr T value = v;7  typedef T value_type;8  typedef integral_constant type; // using injected-class-name9  constexpr operator value_type() const noexcept { return value; }10};11 12using false_type = integral_constant<bool, false>;13using true_type = integral_constant<bool, true>;14 15template <class T, class U>16struct is_same : false_type {};17 18template <class T>19struct is_same<T, T> : true_type {};20 21#endif22