Summary
This episode explores the curious `requires requires` syntax in C++20 concepts. Jason explains that this pattern appears when making ad-hoc constraint expressions directly within a template declaration instead of defining a proper named concept. He demonstrates how `requires requires` allows checking for valid expressions (like whether a type has a call operator) inline, but notes that Bjarne Stroustrup has identified this as a code smell that suggests a missing concept definition.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[temp.concept]70% match -
[temp.constr]69% match -
[constraints.overview]64% match -
[namespace.constraints]62% match -
[constraints]62% match -
[temp.constr.concept]57% match -
[expr.prim.req.general]56% match -
[expr.prim.req.simple]55% match -
[expr.prim.req]52% match -
[temp.constr.decl]52% match - + 12 more related sections