#include <iostream>

struct S
{
    // template version
    template<class T>
    void method(T&& arg)
    {
        std::cout << __PRETTY_FUNCTION__ << '\n';
    }
    
    // overload
    void method(std::string& arg)
    {
        std::cout << __PRETTY_FUNCTION__ << '\n';
    }
};

int main()
{
    S s;
    
    // will invoke overload : perfect match
    std::string str = "Something";
    s.method(str);
    
    // but not here
    s.method(10);
    s.method(20U);
    s.method("ref to const array");
    
    // not here either (not lvalue reference).
    s.method(std::string("Not here"));
}
