If you write a template like this one
template <typename T> using X = const T; what's the meaning of const T?
To know about it I wrote this program:
std::cout << std::boolalpha << std::is_same_v<X<int&>, int&> << '\n' << std::is_same_v<X<const int*>, const int* const> << '\n' << std::is_same_v<X<const int&>, const int&> << '\n'; and for my surprise all the answers were true.
Why X < int&> is an int& and not a 'const int&'?
I compiled it with gcc 7.3.0 and clang++ 6.0. Same answer.
Tis "pointer to int" (int *), then it's reasonable forconst Tto be "const pointer to int" (int *const), rather than "pointer to const int" (const int *).