4 ms·
That's something different, code generation. The point is that C++26 will have compile-time reflection without any need for an external code generation tool, si
by logicchains 2y ago
That's something different, code generation. The point is that C++26 will have compile-time reflection without any need for an external code generation tool, similar to Zig.
- kstrauser 2y agoWith the main difference being that if you start Zig today, you’ll get to use that a good decade before it’s reliably available in C++. Hmm. Actually, now that makes me want to learn Zig.
- kevin_thibedeau 2y agoConsteval is usable today for a lot of scenarios that would require code generation tooling in years past.
- dwattttt 2y agoHow does consteval interact with thread_local? Defined (although I'm not sure what definition could make sense), error, or the dreaded "No diagnostic required"?
- flohofwoe 2y agoIn the end, generics, comptime and code generation are just different steps on the 'stamping out specialized code and data' ladder though (e.g. all three are useful).
- int_19h 2y agoErgonomics matters, though. In C++, this feature is bolted onto the language decades after it was originally designed. Zig is designed around this from the get go (which is why it doesn't have e.g. templates as a distinct feature).