fork download
  1. template<typename T1,
  2. typename T2 = decltype(&T1::method)>
  3. struct Foo {};
  4.  
  5. struct Bar
  6. {
  7. void method() { }
  8. };
  9.  
  10. template<class T> Foo<T> foo(T&)
  11. {
  12. return Foo<T>();
  13. }
  14.  
  15. int main()
  16. {
  17. Bar t;
  18. foo(t);
  19. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty