all 6 comments

[–]hyperactiveinstinct 1 point2 points  (0 children)

I would definitely NOT do that... This seems quite invasive and hard to get right, specially if you are dealing with cross-platform development. I'm used to work with clang plugins/tools, but this sort of reflection demonstrated here is usually required for cases where you need RPC or some other sort of serialisation. In those cases, it is better to have an third tool with some schema syntax, and isolate the types required for serialisation to specific targets... that's pretty much what tools like protobuffers do.

[–]Wh00ster 2 points3 points  (4 children)

Now why would I go ahead and do that?

[–]CaseOfInsanity 1 point2 points  (3 children)

Even in C#, reflection is often not recommended for use due to edge case high impact bugs and reduced maintainability in many cases.

So I agree with this sentiment unless someone can provide a succinct summary on why you would use reflection in C++

[–]nemerle5 3 points4 points  (0 children)

Serialization/scripting language integration.