fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Foo {
  5. int meth() { return 13; }
  6. };
  7.  
  8. int main() {
  9. auto func = &Foo::meth;
  10. decltype((declval<Foo>().*func)()) bar = 42;
  11.  
  12. cout << bar << endl;
  13. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
42