Skip to content

Add member type to member_descriptor #50

Description

@Lastique

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) > >
{
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions