constexpr
is a Platform
Let me share a useful insight with you: constexpr
is a platform.
Just like you write code that targets Windows or a microcontroller,
you write code that targets compile-time execution.
In both cases you restrict yourself to the subset of C++ that works on your target platform,
use conditional compilation if your code needs to be portable,
and execute it on the desired target platform.
You can thus view constexpr
as another platform you can target;
it just so happens to be run by your compiler.
This insight can answer a lot of design questions surrounding constexpr
.