fork download
  1. #include <iostream>
  2. void func(int * const &) {}
  3. void func(int *) {}
  4.  
  5. template <typename T> void tfunc(const T &) {std::cout << "#1\n";}
  6. template <typename T>void tfunc(T *) {std::cout << "#2\n";}
  7.  
  8. int main()
  9. {
  10. int a = 0;
  11.  
  12. //func(&a); // ambiguous
  13. tfunc(&a); // unambiguous
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
#2