fork download
  1. template <typename Derived, typename X, typename Y>
  2. struct SomeBase {};
  3.  
  4. template <typename X, typename Y>
  5. struct SomeBaseFactory {
  6. template <typename Derived>
  7. struct apply { typedef SomeBase<Derived, X, Y> type; };
  8. };
  9.  
  10. // Generic application
  11. template <typename Fac, typename Derived>
  12. struct apply {
  13. typedef typename Fac::template apply<Derived>::type type;
  14. };
  15.  
  16. template <typename... Args>
  17. struct Foo: apply<Args, Foo<Args...>>::type... {
  18. };
  19.  
  20. typedef Foo< SomeBaseFactory<int, float> > SuperFoo;
  21.  
  22. int main() {}
Success #stdin #stdout 0s 2824KB
stdin
Standard input is empty
stdout
Standard output is empty