Hacker News new | past | comments | ask | show | jobs | submit login

The reason why you want it to be part of the API contract is to avoid future breaks.

If you publish a library as "constexpr" you are indicating to your users that they can use it in a compile-time context and that future changes to your implementation will remain compile-time executable. If you just say "anything that can be computed at compile time gets auto-deduced to constexpr" then you rely on some library that is compile-time executable by coincidence but you really really really need it to be compile-time executable. Now when that library owner makes an edit that means it cannot be executed at runtime your code breaks.




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

Search: