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

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

    And I would love a pony, but ponies aren't free. :-p

    http://en.wikibooks.org/wiki/C%2B%2B_Programming/RTTI is what you're going to get. Reflection like you're thinking about -- fully descriptive metadata available at runtime -- just doesn't exist for C++ by default.

提交回复
热议问题