|
Boost : |
From: Julien Blanc (julien.blanc_at_[hidden])
Date: 2021-03-15 08:06:01
Le 2021-03-15 08:47, Alexander Grund via Boost a écrit :
> Am 14.03.21 um 18:33 schrieb Peter Dimov via Boost:
> I.e. the problem with the toggles is, that they are toggles only. It
> is impossible to return both static and not-static members, which
> especially for functions is useful
> In general it is impossible to return ALL members, e.g.
> `boost::mp11::mp_for_each<describe_members<T>>` could be useful,
> especially for a compiler implementation
I've been thinking about that, and i believe reversing the modifiers
could give a cleaner interface for doing it. ie, something like:
describe_members<T, mod_filter_none> --> returns everything
describe_members<T, mod_filter_no_data_members> --> returns only the
function, whatever their visibility is, and whether they are inherited
or not.
describe_members<T, mod_filter_no_inherited> --> returns only the
members (data or functions) that are not inherited
describe_members<T, mod_filter_no_static> --> returns only the members
(data or functions) that are not static
describe_members<T, mod_filter_no_inherited | mod_filter_no_functions |
mod_filter_no_static> --> returns only the data members that are not
inherited and not static (could be provided as an alias,
mod_filter_self_data_members_only)
From what i have seen, it may event be built on top of the current
describe machinery (there is, i believe, pretty much everything in the
details namespace to implement it without touching the macros and the
current model).
Regards,
Julien
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk