Created
February 5, 2016 21:50
-
-
Save ledif/a70b13ba7a0af16d3f7c 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
#include <iostream> | |
#include <type_traits> | |
template<int A, typename B, typename C> | |
struct X { }; | |
template<typename T> | |
struct is_X : std::false_type {}; | |
template<typename... Args> | |
struct is_X<X<Args...>> : std::true_type {}; | |
int main(int argc, char* argv[]) { | |
using my_x = X<0, float, char>; | |
std::cout << is_X<my_x>::value << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
include
include <type_traits>
template<int A, typename B, typename C>
struct X { };
template
struct is_X : std::false_type {};
template<int I, typename... Args>
struct is_X<X<I, Args...>> : std::true_type {};
int main(int argc, char* argv[]) {
using my_x = X<0, float, char>;
std::cout << is_X<my_x>::value << std::endl;
return 0;
}