Created
February 27, 2016 17:59
-
-
Save pfultz2/dcb5fd9f181a3df9dbdf 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 Interface> | |
struct GenericInterface | |
{ | |
std::string query_interface() const | |
{ | |
return fit::conditional( | |
[](auto&& x) FIT_RETURNS(x.interface()), | |
[](auto&& x) FIT_RETURNS(x.get_my_interface()), | |
[](auto&& x) FIT_RETURNS(x.myInterface()) | |
)(i); | |
} | |
Interface i; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment