C++ Snippet
Template Constraints with C++20 Concepts (and SFINAE Fallback)
Difficulty: Hard
C++20 concepts (`requires` clauses) replace decades of SFINAE incantations with readable predicate-style template constraints. The runnable accordions in this entry use the C++17 `std::enable_if_t` SFINAE form because the test compiler is GCC 9.2 (which lacks concepts), and the C++20 equivalent is shown in inline comments. Reach for concepts on any compiler that supports them; reach for SFINAE only when constrained by toolchain age.
