There is a function "remove_cv" (http://en.cppreference.com/w/cpp/types/remove_cv) to remove constant and volatile.
My question is why it is possible to remove from "const volatile int" to "int"
and from "int * const volatile" to "int*" but "const volatile int*" is the same as before remove.
The possible code is from the site
template< class T >
struct remove_cv {
typedef typename std::remove_volatile<typename std::remove_const<T>::type>::type type;
};
template< class T > struct remove_const { typedef T type; };
template< class T > struct remove_const<const T> { typedef T type; };
template< class T > struct remove_volatile { typedef T type; };
template< class T > struct remove_volatile<volatile T> { typedef T type; };
I can't understand the rules for the pointer type deduction.
Can you guys show me the way for/how compiler possibly do it?
Are there rules for the deduction?