4 ms·
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
by Quekid5 4y ago
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.)
- elcritch 4y agoCompile 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!