fork(10) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename ReturnType, typename... Args>
  5. auto CallIt( ReturnType( *method )( Args... ) ) -> ReturnType(*)(Args...)
  6. {
  7. return method;
  8. }
  9.  
  10. int main() {
  11.  
  12. auto test = CallIt( +[] ( int a, int b )
  13. {
  14. return a > b;
  15. } );
  16.  
  17. cout << test(4,1);
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1