Last Updated: May 17, 2026
SFINAE stands for Substitution Failure Is Not An Error. It's the rule that lets the compiler quietly discard a template overload when substituting types into it produces ill-formed code, instead of stopping with a hard error. SFINAE was the main tool for constraining templates from C++98 all the way through C++17, and you'll still see it everywhere in older libraries and codebases. Concepts in C++20 replace most of it, but understanding SFINAE is how you read the C++ template ecosystem written before then.