How can I add reflection to a C++ application?

前端 未结 28 1700
感动是毒
感动是毒 2020-11-21 11:25

I\'d like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I\'m talking native C++ here, not managed C++, which has reflection

28条回答
  •  面向向阳花
    2020-11-21 11:41

    EDIT: CAMP is no more maintained ; two forks are available:

    • One is also called CAMP too, and is based on the same API.
    • Ponder is a partial rewrite, and shall be preferred as it does not requires Boost ; it's using C++11.

    CAMP is an MIT licensed library (formerly LGPL) that adds reflection to the C++ language. It doesn't require a specific preprocessing step in the compilation, but the binding has to be made manually.

    The current Tegesoft library uses Boost, but there is also a fork using C++11 that no longer requires Boost.

提交回复
热议问题