fork download
  1. #include <iostream>
  2.  
  3. template <int N>
  4. char func() { return '*'; }
  5.  
  6. template <int N>
  7. int func() { return N; }
  8.  
  9. int main() {
  10. char (*f1)() = func<4>;
  11. int (*f2)() = func<4>;
  12.  
  13. std::cout << f1() << std::endl;
  14. std::cout << f2() << std::endl;
  15. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
*
4