2 ms·
Does “const” mean “immutable” and “constexpr” mean “compile-time” in C++? That’s funny.
by keybored 2y ago
Does “const” mean “immutable” and “constexpr” mean “compile-time” in C++? That’s funny.
- kstenerud 2y agoconstexpr was originally intended for "things that can be computed at compile time". But for something to be computable at compile-time, it would have to also be immutable.
- keybored 2y agoI can imagine a for loop with `i` which computes something over a static value where `i` isn’t immutable but is needed to compute the “constexpr” value.