fork download
  1. template <typename Ret, typename T, Ret(T::*mptr)()>
  2. void f() {}
  3.  
  4. template <typename Ret, typename T, Ret(T::*mptr)()>
  5. void g()
  6. {
  7. f<Ret,T,mptr>();
  8. }
  9.  
  10. struct A {
  11. int a() { return 0; }
  12. };
  13.  
  14. int main() {
  15. g<int, A, &A::a>();
  16. }
Success #stdin #stdout 0.01s 2720KB
stdin
Standard input is empty
stdout
Standard output is empty