...

/

The Four Ways to Use Concepts

The Four Ways to Use Concepts

Learn how to use concepts in four different ways.

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 ...