It's not an optimization in this case - it's a mechanism that produces what is semantically a compile-time constant, and can therefore be used in any context in which one is required by the language.
C++ has this with constexpr, but it's not as rich in terms of things that it can do. In D, IIRC, pretty much anything goes.
C++ has this with constexpr, but it's not as rich in terms of things that it can do. In D, IIRC, pretty much anything goes.