cbeck88 / visit_struct

A miniature library for struct-field reflection in C++
Boost Software License 1.0
503 stars 47 forks source link

Get member variable pointer at compile-time #18

Open indianakernick opened 4 years ago

indianakernick commented 4 years ago

visit_pointers passes the member variable pointers to the given callable. At this point, the constexpr-ness of the pointer is lost. visit_accessors passes accessor objects to the given callable. accessor has the pointer as a template parameter. I propose adding this to accessor:

static VISIT_STRUCT_CONSTEXPR auto value = ptr;

This would make it possible to access the pointer as a compile-time constant.

cbeck88 commented 4 years ago

Hi --

Sorry I've been MIA on this library for a long time. I got married like a year and a half ago and then got super busy with other stuff and never came back to it.

I'm really glad that there are people using this library. I think your suggestion is great, I'm gonna make some time soon to read all the issues that have opened and either make PRs to try to address them or ask questions. If you want to open a PR I might also just merge it.

This library hasn't changed in a long time and there aren't any bugs afaik, so I'm not sure if it needs a more active maintainer as such, but if there's someone who wants to take over and add more stuff, especially any stuff related to new C++ features, I'm probably receptive to that.