I have a template function that checks the type of a template argument with an if constexpr such as
template <typename T>
bool something(T arg) {
if constexpr (std::is_integral_v<T>) {
return true;
} else {
// What can I write here so that something<double>(0.0) does not compile?
}
return false;
}
How can I make the code fail to compile if none of my if constexprs match?