2 ms·
This already exists with macros, templates, and compiler extensions, if you want completely unusable/unreadable code that takes forever to build.
by jjmarr 2y ago
This already exists with macros, templates, and compiler extensions, if you want completely unusable/unreadable code that takes forever to build.
- pjmlp 2y agoDepends on the C++ version. With C++23 can be made relatively readable, and with the right compiler, builds within sensible timeframe.
- jjmarr 2y agoC++23 doesn't have full reflection yet. That's coming in C++26. I've seen the vast majority of build time in a very large C++23 project be taken up by reflection in fmtlib and magic_enum because both have to use templates (I think).
- pjmlp 2y agoI didn't said it has, rather that template metaprogramming can be both readable, and with the right compiler relatively fast.
- vitaut 2y ago{fmt} doesn't use reflection and is optimized for build speed using type erasure: https://vitaut.net/posts/2024/faster-cpp-compile-times/ https://vitaut.net/posts/2024/faster-cpp-compile-times/