Skip to content

Instantly share code, notes, and snippets.

@pfultz2
Created February 27, 2016 17:59
Show Gist options
  • Save pfultz2/dcb5fd9f181a3df9dbdf to your computer and use it in GitHub Desktop.
Save pfultz2/dcb5fd9f181a3df9dbdf to your computer and use it in GitHub Desktop.
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