fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3. using namespace std;
  4.  
  5. template <typename T>
  6. void f(const T&) {
  7. cout << "f(T&)" << endl;
  8. }
  9.  
  10. template <typename T>
  11. void f(const T*) {
  12. cout << "f(T*)" << endl;
  13. }
  14.  
  15. int main() {
  16. // your code goes here
  17. f(new int);
  18. return 0;
  19. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
f(T&)