Last active
August 29, 2015 14:25
-
-
Save mattkretz/8ab41298abc1513a06b2 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 <type_traits> | |
#include <utility> | |
template<typename F, typename A> | |
std::true_type test(int bla); | |
template<typename F, typename A> | |
std::false_type test(...); | |
template<typename F, typename A> | |
struct testStruct | |
{ | |
using type = decltype(test<F, A>(1)); | |
}; | |
template<typename F, typename A> | |
using tester = typename testStruct<F, A>::type; | |
template<typename X, typename Y> | |
typename | |
std::enable_if< | |
// now working! | |
tester<X, Y>::value, | |
Y>::type foo() | |
{ | |
return 0; | |
} | |
int main() | |
{ | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment