Case 1 The possible implementation of std::remove_const is
template< class T > struct remove_const { typedef T type; };
template< class T > struct remove_const<const T> { typedef T type; };
When i use them
std::remove_const<int> // use the first version
std::remove_const<const int> // use the second version
Case 2 If i comment the second version
template< class T > struct remove_const { typedef T type; };
//template< class T > struct remove_const<const T> { typedef T type; };
And use them
std::remove_const<int> // use the first version
std::remove_const<const int> // use the first version
In the Case 1 , how does compiler decide to choose the second version for const int ?