rttrorg / rttr

C++ Reflection Library
https://www.rttr.org
MIT License
3.11k stars 430 forks source link

rttr::visitor support for enumerations #271

Open emxaz opened 4 years ago

emxaz commented 4 years ago

I'm trying to automatically bind registered enums (rttr::registration::enumeration) via pybind, which wants compile-time type information. It seems that when I call rttr::visitor::visit on a type where is_enumeration() == true, then none of the functions on the visitor are called. Is there an alternative approach to do this, or am I doing something wrong?

ulricheck commented 3 years ago

I just hit the same problem .. i'm generating python wrappers for my C++ framework and wanted to automatically wrap enums using the visitor pattern - any hints on how to achieve this - would it be difficult to implement this feature ?