4 ms·
> Maybe the language should work the other way around and everything should be constexpr by default and functions should opt out of constexpr-ness, but that's 4
by scatters 3y ago
> Maybe the language should work the other way around and everything should be constexpr by default and functions should opt out of constexpr-ness, but that's 40 years too late for C++.
That's how lambdas behave in C++, so it's definitely feasible. gcc has a flag, -fimplicit-constexpr I think, that does this for regular functions, and it doesn't appear to cause any significant issues. I think there has been some talk around making this the language behavior at some point in the future.