Re:The C23 edition of Modern C is now available for free
by PaulDavisThe1st on Tuesday October 15, 2024 @11:49PM
(#41855426)
What they mean is this:
with no extra code. It's called reflection, where the compiler can generate good-enough code to generate a character-stream serialization of an object without any human intervention.
[ Parent
| on HN ]
Re:The C23 edition of Modern C is now available for free
by wakawaka28 on Wednesday October 16, 2024 @04:23AM
(#41856808)
I know what reflection is of course. C++ makes it easy to implement IO. If you're asking for a reflection-based solution with less effort, you are practically asking for zero extra code. Anyway, C++ does not yet have reflection but who's to say how anyone wants any particular data to be dumped? A default implementation is nice but less useful than you make it sound. In any case, there are libraries approximating what you described (usually with macros and stuff) and reflection is totally coming at some point.