Created
April 26, 2020 00:57
-
-
Save rolandschulz/645c615da8e1d1ce685ffec01f6ca85c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class T, T v> | |
struct integral_constant { | |
static constexpr T value = v; | |
using value_type = T; | |
using type = integral_constant; // using injected-class-name | |
constexpr operator value_type() const noexcept { return value; } | |
constexpr value_type operator()() const noexcept { return value; } //since c++14 | |
}; | |
using false_type = integral_constant<bool, false>; | |
using true_type = integral_constant<bool, true>; | |
template<class T, class U> | |
struct is_same : false_type {}; | |
template<class T> | |
struct is_same<T, T> : true_type {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment