SFINAE: Substitution Failure Is Not An Error
summary
Explains that SFINAE is lazy and performs substitution in lexical order, stopping at the first failure so later templates never instantiate; shows two otherwise identical overloads that behave differently solely because of parameter order and a static_assert that is not in the immediate context; points out that C++20 concepts check constraints after substitution so they can lose SFINAE friendliness; demonstrates a practical lazy short-circuiting conjunction trait implementation that expands predicates into sequential SFINAE checks and successfully short‑circuits.
AI-written summary · about
related talks
04mA Static Alternative to Virtual Functions, Using Expression SFINAE
06mLightning Talk: How Hard Can it be to SFINAE in C++03?
55mCustom Overload Sets and Inline SFINAE for Truly Generic Interfaces
53mThe Detection Idiom - a simpler way to SFINAE
05mLightning Talk: The Finer Points of Parameter Packs
55mTemplates Made Easy With C++20
05mYou must type it three times
39mAre You Structure Bindable? A Tour via Concepts, SFINAE & Herb Sutter's Pattern Matching
