I was reading about std::decay on Stack Overflow (c++ - What is std::decay and when it should be used? - Stack Overflow) and in the accepted answer it is stated that:
If it accepted its parameters by reference, then T1 will be deduced as an array type, and then constructing a pair<T1, T2> will be ill-formed.
The following code demonstrates the issue I have:
Code:
#include <iostream>
#include <typeinfo>

template <class T1, class T2>
void f(T1 &x, T2 y)
{
    std::cout << typeid(x).name() << '\n';
    std::cout << typeid(y).name() << '\n';
}

int main()
{
    f("foo", "bar");
    return 0;
}
Running this with VS 2015 gives me the following:
Code:
char const [4]
char const *
I don't really understand why T1 is being deduced as an array type. "foo" has type const char* so does this mean x has type const char*& which evaluates to const char array? I can see that the type T1 contains size information so it's definitely an array type and no array decay happened but what I'm having trouble with is the syntax and how adding the reference operator results in an array and removes the implicit cast.

Cheers!