Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This already exists with macros, templates, and compiler extensions, if you want completely unusable/unreadable code that takes forever to build.


Depends on the C++ version.

With C++23 can be made relatively readable, and with the right compiler, builds within sensible timeframe.


C++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).


{fmt} doesn't use reflection and is optimized for build speed using type erasure: https://vitaut.net/posts/2024/faster-cpp-compile-times/


I didn't said it has, rather that template metaprogramming can be both readable, and with the right compiler relatively fast.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: