I have a use case where I would like to process types of members of a described struct. While it is possible to deduce the member type from member_descriptor::pointer, I think it would be helpful if the type was readily available as a member_descriptor::type typedef. This would save the user from having to define helper traits such as this:
template< typename T >
struct member_type;
template< typename T, typename U >
struct member_type< T (U::*) >
{
using type = T;
};
template< typename Descr >
struct deduce_member_type :
member_type< std::remove_cv_t< decltype(Descr::pointer) > >
{
};
I have a use case where I would like to process types of members of a described struct. While it is possible to deduce the member type from
member_descriptor::pointer, I think it would be helpful if the type was readily available as amember_descriptor::typetypedef. This would save the user from having to define helper traits such as this: