5 ms·
One downside to implicit constexpr is its harder to know when an API intends it as a user and harder to enforce it works as an author. Seems like it could be e
by epage 4y ago
One downside to implicit constexpr is its harder to know when an API intends it as a user and harder to enforce it works as an author. Seems like it could be easy to break compatibility.
- mhh__ 4y agoThat doesn't really happen in D because basically everything is "constexpr" unless it does something like inline ASM or unions with pointers in them
- layer8 4y agoAt least users would notice at compile time when it breaks. With both implicit and explicit constexpr, authors who care could use the explicit form, and any implicit constexpr would be “use at your own risk”, but would still be guaranteed to work as long as you don’t upgrade the dependency.