So far, we have covered the most important semantic changes to the language beginning with the C++ 11 standard. The purpose of this chapter is to highlight key changes that might be useful in writing idiomatic Modern C++ programs. The C++ 17 standard added some more stuff into the language. We will be highlighting a few more features of the language to wrap up this discussion.
Miscellaneous features
Fold expressions
The C++ 17 standard added support for fold expressions to ease the generation of variadic functions. The Compiler does pattern matching and generates the code by inferring the intent of the programmer. The following code snippet demonstrates the idea:
//---------------- Folds.cpp
//--------------- Requires...