Constraints and concepts (since C++20)
Min standard notice:
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
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| CWG 2428 | C++20 | could not apply attributes to concepts | allowed |