rttr
rttr copied to clipboard
Best way to find "directly" inherited types?
Lets say we need the "tree" of inheritance to display in a gui or generate wrappers (non cpp) mirroring a class hierarchy
get_base_classes() returns ALL classes, as does get_derived_classes() is_base_of() and is_derived_from() both consider ALL types inherited
What it the best way to find the types "directly" inherited using the RTTR public API?
Ex struct a {} ; struct b : a {}; struct c {} ;
struct d : c, b {};
We want to return range of types "c, b" for stuct d rather than "a, b, c" as get_base_classes() provides
Sorry, but at the moment there is no such function to get this information. I have to provide such function similar to this like get_properties(filter_item)
PR #237 - add rttr:type::get_direct_base_classes()