Hacker News new | past | comments | ask | show | jobs | submit login

Constexpr all the things is kind of a super-power of C++. Zig has an even more powerful comptime feature, but that's an aside.

(Bonus points: Declare a static constexpr value in a compilation unit... and use it somewhere at runtime to get the moral equivalent of consteval for the values you care about.)




Compile time typing is awesome (in Nim its `{.compileTime.}`). Combine it with compile time "duck typing" and you can write some powerful but still simple code. I hope the style becomes more common!




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

Search: