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

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.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: