david50407
5/22/2015 - 3:52 PM

gistfile1.cpp

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();
}