fork download
  1. #include <map>
  2. #include <iostream>
  3.  
  4. template<class Range>
  5. void go(Range &r)
  6. {
  7. std::cout << "First" << std::endl;
  8. }
  9.  
  10. template<class K, class V>
  11. void go(const std::map<K, V> &m)
  12. {
  13. std::cout << "Second" << std::endl;
  14. }
  15.  
  16.  
  17. int main()
  18. {
  19. const std::map<int, int> m;
  20. //^^^^^ note the const.
  21. go(m);
  22. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
Second