4 ms·
Templates are not nearly as powerful as lisp macros and stitching together code is 100 time more complex (bordering on Turing tarpit territory), but almost arbi
by gpderetta 2y ago
Templates are not nearly as powerful as lisp macros and stitching together code is 100 time more complex (bordering on Turing tarpit territory), but almost arbitrary compile time code generation is still possible. See boost.lambda, boost.spirit, eigen or anything using expression templates for example.
Aside the complexity, the main thing C++ currently lacks is code introspection to modify existing code without using an ad-hoc DSL. I think that even the reflection proposals do not go as far as actually introspecting code.
- lispm 2y agoCan a template access a database/filesystem/network at compile time? Any idea about that?
- jandrewrogers 2y agoThe proposals and features around std::embed and #embed (part of C23) are on their way to enabling this.