Constraints and concepts (since C++20)

Class templates, function templates (include generic lambdas), and other templated functions (typically members of class templates) might be associated with a constraint, which specifies the requirements on template arguments, which can be used to select the most appropriate function overloads and template specializations.

# Notes

Feature-test macro Value Std Feature __cpp_concepts 201907L (C++20) Constraints 202002L (C++20) Conditionally trivial special member functions

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
CWG 2428C++20could not apply attributes to conceptsallowed

# See also