Created
October 20, 2016 20:56
-
-
Save akindyakov/cd170433ffc43b6276ccd09c7968bddd 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 T1, typename T2> | |
struct First {}; | |
template<typename T1, typename T2> | |
struct Second {}; | |
template <typename T1, typename T2> | |
struct IsHell : std::false_type {}; | |
template <typename T1, typename T2, typename T3> | |
struct IsHell<First<T1, T2>, Second<T2, T3>> : std::true_type {}; | |
int main() { | |
std::cout << std::boolalpha; | |
std::cout << IsHell<First<int, double>, Second<double, int>>::value << std::endl; | |
std::cout << IsHell<First<int, double>, Second<long, int>>::value << std::endl; | |
std::cout << IsHell<Second<long, int>, First<int, double>>::value << std::endl; | |
std::cout << IsHell<int, int>::value << std::endl; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
true
false
false
false