fork(1) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. typedef int (*get_max)();
  5.  
  6. template<get_max FUNC>
  7. get_max func()
  8. {
  9. return FUNC;
  10. }
  11.  
  12. int foo(){ return 5; }
  13.  
  14. int main()
  15. {
  16. std::cout << func<foo>()() << std::endl;
  17. };
  18.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
5