This web site contains all the code listings from the book Exploring C++ 20 (Apress). They are divided into two folders as follows:
These files are extracted from the book verbatim. They require full support for modules, including import of standard library headers. Set the CMake variable
TRUE in order to compile these files. At this time
(2020-07-10), no compiler release or prerelease can compile these
files. I will try to keep this site updated as compiler vendors
release more C++ 20 functionality.
These files are extracted from the book, changing
<header>. Also module
declarations are commented out, as is the
I provide header files to replace local modules.
In each code folder is a subfolder for every chapter. Every
chapter folder contains the files for that chapter, including
CMakeLists.txt and test scripts. All files use POSIX
line endings (newline only).
The data directory contains some additional sample files that you can use as input for some of the exercises,.
To compile the examples, you will need cmake and, of course, a C++ compiler. As of 2020-07-10, no compiler and library implements the full C++ 20 draft standard. The GCC compiler and library are the most complete, and what I used when writing the book.
As of GCC 10.1, libstdc++ provides all the parts of C++ 20
that Exploring C++ 20 requires except for modules
The fmt.dev project implements a functional equivalent,
albeit in the
In order to emulate the standard, I wrote my own
to use the
although I actually used a smaller, simpler fork,