Difference between “if constexpr()” Vs “if()”
The only difference is that if constexpr is evaluated at compile time, whereas if is not. This means that branches can be rejected at compile time, and thus will never get compiled. Imagine you have a function, length, that returns the length of a number, or the length of a type that has a .length() … Read more