Hmm, it seems this constexpr if is much more limited than I realized then. If I understood correctly the code in the the body of the constexpr if has to be correct even if the condition does not hold. I.e., this code:
template<typename T>
void func(T x) {
if constexpr ( std::is_same< T, ClassWithMemberF>::value ) {
x.f();
}
}
will not work if you pass in a type for x that does not have a member function f. Is my understanding right? If so, constexpr if is not nearly as nice as I thought...