August 2020
Beginner to intermediate
653 pages
16h 55m
English
Modules are the way of the future, but until the future arrives, we are stuck with #include files. Billions of lines of C++ code currently use #include files, so you need to know how they work. With a little bit of discipline, you can still separate interface from implementation and achieve much of what modules offer.
The basic principle is that you can define any function or global object in any source file. The compiler does not care which file contains what. As long as it has a declaration for every name it needs, it can compile a source file to an object file. (In this ...