samedi 30 septembre 2017

What does 'char (&) [13]' mean?

As an old c++ programmer, I'm learning c++11 recently. When reading Effective Mordern C++, I found the interesting type:

char (&) [13]

When passing an array to a function template requiring T&:

template<typename T>
void funcTemplate1(T& param)
{
    std::cout << boost::typeindex::type_id_with_cvr<T>().pretty_name() << std::endl;
}
void main()
{
    char szHello[] = "Hello, World";
    funcTemplate1(szHello);
}

It output :

char (&) [13]

Never have seen that. What does is mean?

Aucun commentaire:

Enregistrer un commentaire