Exploring the Standard Concepts Library

Expand your knowledge of the standard library in this lesson.

The standard concepts library

The standard library provides a set of fundamental concepts that can be used to define requirements on the template arguments of function templates, class templates, variable templates, and alias templates, as we have seen throughout this section. The standard concepts in C++20 are spread across several headers and namespaces. We’ll present some of them in this lesson although not all of them (see the Further Readings section at the end of this course).

The main set of concepts is available in the <concepts> header and the std namespace. Most of these concepts are equivalent to one or more existing type traits. For some of them, their implementation is well defined; for some, it’s unspecified. They’re grouped into four categories: core language concepts, comparison concepts, object concepts, and callable concepts. This set of concepts contains the following (but not only):

Get hands-on with 1200+ tech skills courses.