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

The idea of static meaning “fully evaluate this at compile time” in D is a good one.


Obligatory C++ comparison: C++ has constexpr since C++11 and constinit since C++20. They mean more or less the same when applied to variables ("must be evaluated at compile-time"), but constinit does not imply constness.


D evaluates until it hits something it can't manipulate at compile time whereas constexpr requires things to be annotated as such, so the difference is slightly more subtle.


While true, Circle C++ compiler works as D does, although that is not standard, thus D does win in expressiveness.




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

Search: