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

前端 未结 28 1611
感动是毒
感动是毒 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:43

    What are you trying to do with reflection?
    You can use the Boost type traits and typeof libraries as a limited form of compile-time reflection. That is, you can inspect and modify the basic properties of a type passed to a template.

提交回复
热议问题