fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Test {
  5. template<typename T>
  6. static bool Function(T x)
  7. {
  8. return true;
  9. }
  10. };
  11.  
  12.  
  13.  
  14. using testfn = bool (*)(int);
  15.  
  16. int main() {
  17. int x=0;
  18.  
  19. testfn fnPointer = Test::Function;
  20. constexpr auto yourFunction = &Test::Function<int>;
  21. std::cout << boolalpha << fnPointer(x) << std::endl;
  22. std::cout << boolalpha << yourFunction(x) << std::endl;
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
true
true