fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct A
  6. {
  7. static int f1(int a, int b)
  8. {
  9. return a + b;
  10. }
  11. };
  12.  
  13. int f2(int a, int b)
  14. {
  15. return a + b;
  16. }
  17.  
  18. template <typename T, T X>
  19. struct wrapper
  20. {
  21. template <typename... Args>
  22. static bool value(Args... blargs)
  23. {
  24. return X(blargs...) == 3;
  25. }
  26. };
  27.  
  28. int main()
  29. {
  30. bool res;
  31. res = wrapper<decltype(&A::f1), &A::f1>::value(1,2);
  32. cout << res << endl;
  33. return 0;
  34. }
Success #stdin #stdout 0s 2884KB
stdin
Standard input is empty
stdout
1