Can I loop through (public) attributes of a C++ class?

后端 未结 2 647
孤独总比滥情好
孤独总比滥情好 2021-01-20 14:41

I found the answer for both C Structs and C# classes but came back empty-handed concerning C++. EDIT : In C, you can\'t. In C# it\'s the GetProperties() method.

相关标签:
2条回答
  • 2021-01-20 15:03

    There is no reflection in C++. So, the answer is, you can't :)

    0 讨论(0)
  • 2021-01-20 15:21

    Here's an article on reflection and how to deal with the fact that c++ doesn't do it.

    0 讨论(0)
提交回复
热议问题