I'm proud to present the early release of my book to C++20 on LeanPub. The book is 50 % done and has more than 300 pages and 150 code examples of content. I will update the book at least two times in 2021. Of course, you will get each update of the book.
How to Get it?
Use the link: Leanpub.com: C++20
My book C++20 is both: a tutorial and a reference to the C++20 standard. It teaches you C++20 and provides you with the details of this new thrilling C++ standard. The thrilling factor is mainly due to the big four of C++20.
- Concepts change the way we think and program templates. They are semantic categories for the template parameters. They enable you to express your intention directly in the type of system. If something goes wrong, you get a clear error message.
- The new ranges library enables it to perform algorithms directly on the container, compose the algorithm with the pipe symbol, and apply them onto infinite data streams.
- Thanks to coroutines asynchronous programming in C++ becomes mainstream. Coroutines are the base for cooperative tasks, event loops, infinite data streams, or pipelines.
- Modules overcome the restrictions of header files. They promise a lot. For example, the separation of header and source files becomes as obsolete as the preprocessor. In the end, we have faster built time and an easier way to build packages.
- Core Language
- Two Wrong Approaches
- Advantages of Concepts
- Usage of Concepts
- Unconstrained Placeholders and Constrained Placeholders
- Abbreviated Function Templates
- Predefined Concepts
- Define Concepts
- Why do we need modules?
- A First Example
- Compilation and Use
- Modularized Standard Library
- Guidelines for a Module Structure
- Module Interface Unit and Module Implementation Unit
- Submodules and Module Partitions
- Templates in Modules
- Module Linkage
- Header Units
- Three-Way Comparison Operator
- Ordering before C++20
- Ordering since C++20
- The Compiler-Generated Spaceship Operator
- Rewriting Expressions
- User-Defined and Auto-Generated Comparison Operators
- Designated Initialization
- Aggregate Initialization
- Designated Initialization
- Function Execution
- Variable Initialization
- Solving the Static Initialization Order Fiasco
- Template Improvements
- Conditionally Explicit Constructor
- Non-Type Template Parameters
- Lambda Improvements
- Template Parameter for Lambdas
- Detection of the Implicitly Copy of the
- Lambdas in an Unevaluted Context and Stateless Lambdas can be Default-Constructed and Copy-Assigned
- New Attributes
- Further Improvements
- Range-base for-loop with Initializers
- The new Character Type of UTF-8 Strings:
enum in Local Scopes
- Default Member Initializers for Bit Fields
- Standard Library
- Ranges Library
- The Concepts Ranges and Views
- Direct on the Container
- Function Composition
- Lazy Evaluation
- A Flavor of Python
- Create a
std::span from a Pointer and a Size
- Modifying the Referenced Objects
- Addressing its Elements
- Container Improvements
constexpr Container and Algorithms
- Consistent Container Erasure
contains for Associative Containers
- String prefix and suffix checking
- Arithmetic Utilities
- Safe Comparison of Integrals
- Mathematical Constants
- Midpoint and Linear Interpolation
- Bit Manipulation
- Calendar and Time-Zone
- Time of day
- Calendar Dates
- Formatting Library
- Format String
- User-Defined Types
- Further Improvements
- A Generator Function
- The Framework
- Atomic Smart Pointer
- Latches and Barriers
- Cooperatively Interruption
- Automatically Joining
- Interrupt a
- Synchronized Outputstreams
- C++23 and Beyond
- Coroutines Library
- Modularized Standandard Library for Modules
- Network Library
- Pattern Matching
State of the Book
Although the book is only 50 % done, I publish it at LeanPub. I will update the book at least two times and assume that I'm done with the book in about a year. I decided to publish it half-done because it provides valuable information even in this early stage.
You can expect the following improvements with future updates.
- More code examples when missing C++20 features are available. Additionally, I reimplement existing examples using the C++20 standard and not prototype libraries such as fmt or date.
- More details on the C++20 features.
- A preview of the new C++23 standard.
- Tutorials to the big four at least: concepts, ranges, modules, and coroutines.
Thanks a lot to my Patreon Supporters: Matt Braun, Roman Postanciuc, Tobias Zindl, Marko, G Prvulovic, Reinhold Dröge, Abernitzke, Frank Grimm, Sakib, Broeserl, António Pina, Sergey Agafyin, Андрей Бурмистров, Jake, GS, Lawton Shoemake, Animus24, Jozo Leko, John Breland, espkk, Louis St-Amour, Venkat Nandam, Jose Francisco, Douglas Tinkham, Kuchlong Kuchlong, Robert Blanch, Truels Wissneth, Kris Kafka, Mario Luoni, Neil Wang, Friedrich Huber, lennonli, Pramod Tikare Muralidhara, Peter Ware, Tobi Heideman, Daniel Hufschläger, Red Trip, Alexander Schwarz, Tornike Porchxidze, Alessandro Pezzato, Evangelos Denaxas, Bob Perry, Satish Vangipuram, Andi Ireland, Richard Ohnemus, Michael Dunsky, Dimitrov Tsvetomir, Leo Goodstadt, Eduardo Velasquez, John Wiederhirn, Yacob Cohen-Arazi, Florian Tischler, and Robin Furness.
Thanks in particular to Jon Hess, Lakshman, Christian Wittenhorst, Sherhy Pyton, Dendi Suhubdy, Sudhakar Belagurusamy, Richard Sargeant, Rusty Fleming, and Said Mert Turkal.
My special thanks to Embarcadero
I'm happy to give online seminars or face-to-face seminars worldwide. Please call me if you have any questions.
Standard Seminars (English/German)
Here is a compilation of my standard seminars. These seminars are only meant to give you a first orientation.
- Phone: +49 152 31965939
- German Seminar Page: www.ModernesCpp.de
- English Seminar Page: www.ModernesCpp.net