constexpr error at compile-time, but no overhead at run-time
Is there a way to cause a compile-time error with a constexpr function, but not do anything at run time? You can use the exact same trick, but instead of using a throw-expression, use an expression that is not a constant expression but does what you want at runtime. For instance: int runtime_fallback(int x) { … Read more