Created
March 8, 2014 19:52
-
-
Save Fiona-J-W/9437920 to your computer and use it in GitHub Desktop.
This file contains hidden or 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<typename...T> struct foo{}; | |
template<template<typename...> class Template, typename Type> | |
struct is_instantiation_of: std::false_type {}; | |
template<template<typename...> class Template, typename...Arguments> | |
struct is_instantiation_of<Template, Template<Arguments...>>: std::true_type {}; | |
int main(){ | |
std::cout << is_instantiation_of<foo, int>::value <<'\n' | |
<< is_instantiation_of<foo, foo<int>>::value << '\n' | |
<< is_instantiation_of<foo, foo<int, float, char>>::value << '\n'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment