DEV Community

Discussion on: Different ways to achieve SFINAE

Collapse
 
pgradot profile image
Pierre Gradot

If the substitution leads to invalid code, the compilation will not fail, it'll not be reported as an error because a substitution failure is not an error.

Maybe the clearest explanation of what SFNIAE really is :)

And if we want to avoid putting ::type at the end, we have the std::enable_if_t helper at our hands

And we also have std::is_integral_v to avoid puttin ::value ;)