language: C++ 4.7.2 (gcc-4.7.2)
date: 202 days 2 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    #include <iostream>
    using namespace std;
    template <typename T>
    void f(T & t)
    {
       cout << __PRETTY_FUNCTION__ << endl;
    }
    void f(const string &)
    {
       cout << __PRETTY_FUNCTION__ << endl;
    }
    void f(int)
    {
       cout << __PRETTY_FUNCTION__ << endl;
    }
    int main()
    {
        f(1.0);
        f(1);
        f(string("sss"));
        string a;
        f(a);
    }
 
http://stackoverflow.com/questions/13182234/can-compiler-tell-me-which-overloaded-or-template-function-it-chose/13188938#13188938