Add member type to `member_descriptor`
- Dominant language
- C++
- Stars
- 78
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
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) > >
{
};
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the definition of `member_descriptor` and the existing tests for member descriptors. Confirm how its `pointer` is exposed, then add coverage showing the requested member type is available and run the relevant test suite; done means the typedef is usable without a helper trait.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100