Skip to content

Instantly share code, notes, and snippets.

@david50407
Last active August 29, 2015 14:21
Show Gist options
  • Save david50407/413f564ebc75a282b28f to your computer and use it in GitHub Desktop.
Save david50407/413f564ebc75a282b28f to your computer and use it in GitHub Desktop.
int main() { return 0; }
template <class T>
struct Interface
{
public:
// static T testing() {};
private:
static T (*__testing_checker)();
};
template <class T>
T (*Interface<T>::__testing_checker)() = T::testing();
class Impl : public Interface<Impl>
{
public:
Impl() {}
static Impl testing() { return Impl(); };
};
void test()
{
Impl::testing();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment