News for hackers. Stuff that matters.
Re:Reflection in C++ by zvrba on Monday June 20, 2016 @01:51AM (#11936262)
You're talking about serialization, and I agree that using reflection for that is both an overkill and somewhat hacky (you still have to define the serialization format).

Reflection on the other hand is immensely useful if you want to, for example, automatically generate type-safe bindings for, say, Python or .NET or Java, from your C++ classes.

Re:Reflection in C++ by ThisIs_MyName on Monday June 20, 2016 @02:45AM (#11936458)
Wouldn't you prefer to generate type-safe bindings at compile-time?
Re:Reflection in C++ by Kristine1975 on Monday June 20, 2016 @02:51AM (#11936477)
Definitely. That's why I'm to hyped for compile-time reflection in C++: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/ (search for "reflection")
Re:Reflection in C++ by slau on Monday June 20, 2016 @03:10AM (#11936553)
One of the authors of that paper, Matúš Chochlík, has been working on this for years. He has a pretty nice implementation that I've used successfully on a number of occasions, even though it requires a pre-compiler pass to generate the necessary data.

If I'm not mistaken, he has been working into getting the necessary data available from the compiler directly (which this paper would confirm).

Link to his existing library: http://kifri.fri.uniza.sk/~chochlik/mirror-lib/html/

Absolutely great guy, as well. Really happy to see him still working on this, year over year.

Edit: DYAC.