100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

C++20: Get the Details.pdf

Rating
-
Sold
-
Pages
678
Grade
A+
Uploaded on
29-09-2025
Written in
2025/2026

Master the latest C++20 features with this comprehensive guide. Learn about concepts, coroutines, modules, ranges, and other modern programming tools to elevate your C++ skills and stay current with cutting-edge development standards. Ideal for students and developers aiming to upgrade their C++ knowledge.

Show more Read less
Institution
Programming For Python Language..
Course
Programming for python language..











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Programming for python language..
Course
Programming for python language..

Document information

Uploaded on
September 29, 2025
Number of pages
678
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

,C++20
Rainer Grimm
This book is for sale at http://leanpub.com/c20

This version was published on 2023-09-13




This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process.
Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many
iterations to get reader feedback, pivot until you have the right book and build traction once you do.

© 2020 - 2023 Rainer Grimm

,Contents

Reader Testimonials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Special Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Special Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Compilation of the Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
How should you read the Book? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Personal Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
About Me . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi


About C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1. Historical Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1 C++98 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 C++03 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 TR1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 C++11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 C++14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 C++17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2. Standardization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 Stage 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Stage 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Stage 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5


A Quick Overview of C++20 . . . . . . . . . . . . . . . . . . . . . . . . 7
3. C++20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

, CONTENTS


3.1 The Big Four . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.1 Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.2 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1.3 The Ranges Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.4 Coroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 Core Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2.1 Three-Way Comparison Operator . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2.2 Designated Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2.3 consteval and constinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.4 Template Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2.5 Lambda Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.2.6 New Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.3 The Standard Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.1 std::span . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.2 Container Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3.3 Arithmetic Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3.4 Formatting Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3.5 Calendar and Time Zones . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4 Concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.4.1 Atomics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.4.2 Semaphores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.4.3 Latches and Barriers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.4.4 Cooperative Interruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4.5 std::jthread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.4.6 Synchronized Outputstreams . . . . . . . . . . . . . . . . . . . . . . . . . . 29


The Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4. Core Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.1 Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.1.1 Two Wrong Approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.1.2 Advantages of Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.1.3 The long, long History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.1.4 Use of Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.1.5 Constrained and Unconstrained Placeholders . . . . . . . . . . . . . . . . . 54
4.1.6 Abbreviated Function Templates . . . . . . . . . . . . . . . . . . . . . . . . 57
4.1.7 Predefined Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.1.8 Define Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.1.9 Requires Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.1.10 User-Defined Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.2 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4.2.1 A First Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
LectWoody Chamberlain College Of Nursng
View profile
Follow You need to be logged in order to follow users or courses
Sold
521
Member since
2 year
Number of followers
183
Documents
1050
Last sold
5 hours ago

3.6

84 reviews

5
40
4
14
3
9
2
1
1
20

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions