Created
May 31, 2017 15:04
-
-
Save njlr/6bb7e04c4f6be7f2a813bf7a5d75f37f 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
template<class T> | |
auto compute(T x) -> decltype( enable_if_t< supportsAPI(T{}), int>{}) { | |
return x.Method(); | |
} | |
template<class T> | |
auto compute(T x) -> decltype( enable_if_t<!supportsAPI(T{}), int>{}) { | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment