SitePoint
  • Premium
  • Library
  • Community
  • Jobs
  • Blog
LoginStart Free Trial
C++20
C++20
Reader Testimonials
Introduction
Conventions
Source Code
How should you read the Book?
Personal Notes
1. Historical Context
1.1 C++98
1.2 C++03
1.3 TR1
1.4 C++11
1.5 C++14
1.6 C++17
2.1 Stage 3
2.2 Stage 2
2.3 Stage 1
3.1 The Big Four
3.2 Core Language
3.3 The Standard Library
3.4 Concurrency
4.1 Concepts
4.2 Modules
4.3 Equality Comparison and Three-Way Comparison
4.4 Designated Initialization
4.5 consteval and constinit
4.6 Template Improvements
4.7 Lambda Improvements
4.8 New Attributes
4.9 Further Improvements
5.1 The Ranges Library
5.2 std::span
5.3 Container and Algorithm Improvements
5.4 Arithmetic Utilities
5.5 Formatting Library
5.6 Calendar and Time Zones
5.7 Further Improvements
6.1 Coroutines
6.2 Atomics
6.3 Semaphores
6.4 Latches and Barriers
6.5 Cooperative Interruption
6.6 std::jthread
6.7 Synchronized Output Streams
7.1 Fast Synchronization of Threads
7.2 Variations of Futures
7.3 Modification and Generalization of a Generator
7.4 Various Job Workflows
Epilogue
8. C++23 and Beyond
8.1 C++23
8.2 C++23 or Later
8.3 Further Information about C++23
10.1 Aggregate
10.2 Automatic Storage Duration
10.3 Callable
10.4 Callable Unit
10.5 Concurrency
10.6 Critical Section
10.7 Data Race
10.8 Deadlock
10.9 Dynamic Storage Duration
10.10 Eager Evaluation
10.11 Executor
10.12 Function Objects
10.13 Lambda Expressions
10.14 Lazy Evaluation
10.15 Literal Type
10.16 Lock-free
10.17 Lost Wakeup
10.18 Math Laws
10.19 Memory Location
10.20 Memory Model
10.21 Non-blocking
10.22 Object
10.23 Parallelism
10.24 POD (Plain Old Data)
10.25 Predicate
10.26 RAII
10.27 Race Conditions
10.28 Regular Type
10.29 Scalar Type
10.30 SemiRegular
10.31 Short-Circuit Evaluation
10.32 Standard-Layout Type
10.33 Static Storage Duration
10.34 Spurious Wakeup
10.35 The Big Four
10.36 The Big Six
10.37 Thread
10.38 Thread Storage Duration
10.39 Time Complexity
10.40 Translation Unit
10.41 Trivial Type
10.42 Undefined Behavior
Index

About C++

1. Historical Context

C++20 is the next big C++ standard after C++11. Like C++11, C++20 changes the way we program in modern C++. This change mainly results from the addition of Concepts, Modules, Ranges, and Coroutines to the language. To understand this next big step in the evolution of C++, let me write a few words about the historical context of C++20.

C++ History

C++ History

C++ is about 40 years old. Here is a brief overview of what has changed in the previous years.

1.1 C++98

At the end of the 80’s, Bjarne Stroustrup and Margaret A. Ellis wrote their famous book Annotated C++ Reference Manual (ARM). This book served two purposes, to define the functionality of C++ in a world with many implementations, and to provide the basis for the first C++ standard C++98 (ISO/IEC 14882). Some of the essential features of C++98 were: templates, the Standard Template Library (STL) with its containers, and algorithms, strings, and IO streams.

1.2 C++03

With C++03 (14882:2003), C++98 received a technical correction, so small that there is no place on the timeline above. In the community, C++03, which includes C++98, is called legacy C++.

1.3 TR1

In 2005, something exciting happened. The so-called Technical Teport 1 (TR1) was published. TR1 was a big step toward C++11 and, therefore, towards Modern C++. TR1 (TR 19768) is based on the Boost project, which was founded by members of the C++ standardization committee. TR1 had 13 libraries that were destined to become part of the C++11 standard. For example, the regular expression library, the random number library, smart pointers and hashtables. Only the so-called special mathematical functions had to wait until C++17.

1.4 C++11

We call the C++11 standard Modern C++. The name Modern C++ is also used for C++14 and C++17. C++11 introduced many features that fundamentally changed the way we program in C++. For example, C++11 had the additions of TR1, but also move semantics, perfect forwarding, variadic templates, and constexpr. But that was not all. With C++11, we also got, for the first time, a memory model as the fundamental basis of threading and the standardization of a threading API.

1.5 C++14

C++14 is a small C++ standard. It brought read-writer locks, generalized lambdas, and extended constexpr functions.

1.6 C++17

C++17 is neither a big nor a small C++ standard. It has two outstanding features: the parallel STL and the standardized filesystem API. About 80 algorithms of the Standard Template Library can be executed in parallel or vectorized. As with C++11, the boost libraries were highly influential for C++17. Boost provided the filesystem library and new data types: std::string_view, std::optional, std::variant, and std::any.

End of PreviewSign Up to unlock the rest of this title.

Community Questions