The Four Ways to Use Concepts

In this section, we’ll learn the four different ways we can use concepts with C++ functions and the four different ways to constrain function templates. Once we understand them and their differences, we’ll see how to choose among the different forms.

Types of concepts

For our examples, let’s assume that we have a concept called Number that requires a built-in arithmetic type of C++. As such, user-defined numeric types are ignored. We’ll use a very simplistic implementation.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy