In this recipe, we will discuss an upcoming addition to C++ that promises to completely change the way we think about template programming called C++20 Concepts. C++ today largely depends on the use of SFINAE to constrain the types that apply to any given template function. As seen in Chapter 4, Using Templates for Generic Programming, SFINAE is hard to write, confusing to read, and slow to compile. This recipe is important as template programming post-C++20 will not only be easier to code and debug, but will also reduce the human costs of template programming, making it easier to read and understand.
Looking at Concepts in C++20
Getting ready
Before beginning, please ensure that all of the technical requirements are met,...