template<class T>
struct TypeInfo {
using value_type = is_pointer<T>::value ? T * : T;
};
This code is just pseudocode. I wanna find value type for each pointer and value.
I'll using this like sizeof(TypeInfo<something>::value_type )
. Can you help me?
You can do it like this:
template<class T>
struct TypeInfo {
using value_type = std::remove_pointer_t<T>;
};