fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<typename T>
  5. using INT_OPERATION = const T(T const, T const);
  6.  
  7. //using func = void(*) (int, int);
  8.  
  9.  
  10. INT_OPERATION<int> add(int const a, int const b)
  11. {
  12. return a + b;
  13. }
  14.  
  15. int main()
  16. {
  17. std::cout << add(1, 2) << std::endl;
  18. return 0;
  19. }
  20.  
  21. /*const int add(int const a, int const b)
  22. {
  23. return a + b;
  24. }
  25. */
  26.  
Compilation error #stdin compilation error #stdout 0s 3340KB
stdin
Standard input is empty
compilation info
prog.cpp:10:48: error: ‘add’ declared as function returning a function
 INT_OPERATION<int> add(int const a, int const b)
                                                ^
prog.cpp: In function ‘int main()’:
prog.cpp:17:23: error: ‘add’ was not declared in this scope
  std::cout << add(1, 2) << std::endl;
                       ^
stdout
Standard output is empty