C++20 Fundamentals

Video description

Sneak Peek

The Sneak Peek program provides early access to Pearson video products and is exclusively available to Safari subscribers. Content for titles in this program is made available throughout the development cycle, so products may not be complete, edited, or finalized, including video post-production editing.

C++20 Fundamentals LiveLessons with Paul Deitel is a code-oriented presentation of C++, one of the world’s most versatile and powerful programming languages. C++ remains hugely popular for the development of systems software, embedded systems, operating systems, real-time systems, communications systems and other high performance computer applications. C++20 Fundamentals LiveLessons is comprehensive and covers all major versions of C++, including: C++11, C++17, and C++20.

The code repository for this LiveLesson is kept at https://github.com/pdeitel/CPlusPlus20FundamentalsLiveLessons and will be kept up to date as lessons are added and as changes are made.

Table of contents

  1. Before You Begin
    1. Before You Begin—Overview
    2. Our Corresponding Books
    3. Getting the Source Code
    4. Compilers We Use
    5. Windows Users: Setting Up Microsoft Visual Studio Community Edition
    6. Linux Users: Setting Up GNU C++
    7. macOS Users: Setting Up Apple Xcode
    8. macOS Users: Installing GNU C++ (g++) 13
    9. Docker
    10. Getting your questions answered
    11. Contacting Paul Deitel
  2. Lesson 1 (for Windows Users): Test-Driving a C++ Application
    1. Test-Driving a C++ Application—Overview
    2. Launching Visual Studio, Creating a Project and Compiling/Running a C++ Application
    3. Contacting Paul Deitel
  3. Lesson 1 (for Linux Users): Test-Driving a C++ Application
    1. Test-Driving a C++ Application—Overview
    2. Updating Linux to use g++ Version 13
    3. Compiling and Running the GuessNumber.cpp
    4. Contacting Paul Deitel
  4. Lesson 1 (Docker and GNU C++ Version): Test-Driving a C++ Application
    1. Test-Driving a C++ Application—Overview
    2. Compiling and Running the GuessNumber.cpp
    3. Contacting Paul Deitel
  5. Lesson 1 (Docker LLVM/Clang C++ Version): Test-Driving a C++ Application
    1. Test-Driving a C++ Application—Overview
    2. Compiling and Running the GuessNumber.cpp
    3. Contacting Paul Deitel
  6. Lesson 1 (macOS Xcode Version): Test-Driving a C++ Application
    1. Test-Driving a C++ Application—Overview
    2. Note About Xcode and Its C++20 Support
    3. Launching Xcode, Creating a Project, and Compiling and Running the Project
    4. Contacting Paul Deitel
  7. Lesson 02: Intro to C++ Programming
    1. Lesson 2 Overview: Intro to C++ Programming
    2. First Program in C++: Displaying a Line of Text
    3. Common Escape Sequences
    4. Modifying Our First C++ Program: Displaying a Single Line of Text with Multiple Statements
    5. Modifying Our First C++ Program: Displaying Multiple Lines of Text with a Single Statement¶
    6. Another C++ Program: Adding Integers
    7. Arithmetic
    8. Decision Making: Equality and Relational Operators
    9. Objects Natural: Creating and Using Objects of Standard Library Class string
  8. Lesson 03: Control Statements, Part 1
    1. Lesson 3 Overview: Control Statements, Part 1
    2. C++ Keywords
    3. if Statement and bool Values
    4. if…else Double-Selection Statement
    5. Nested if…else Statements
    6. Conditional Operator (?:)
    7. while Iteration Statement
    8. Counter-Controlled Iteration
    9. Counter-Controlled Iteration: Calculating the Class Average for 10 Students
    10. Sentinel-Controlled Iteration
    11. Sentinel-Controlled Iteration: Calculating the Class Average for an Arbitrary Number of Students
    12. Nested Control Statements
    13. Nested Control Statements—Implementing the Program
    14. Preventing Narrowing Conversions with List Initialization
    15. Compound Assignment Operators
    16. Increment (++) and Decrement (--) Operators
    17. Fundamental Types Are Not Portable
    18. Objects Natural Case Study: Supersized Integers—Overview
    19. Objects Natural Case Study: Supersized Integers with the Boost Multiprecision Open Source Library’s cpp_int Class
    20. Objects Natural Case Study: Supersized Integers—Compiling and Running the Example in Microsoft Visual Studio
    21. Objects Natural Case Study: Arbitrary Precision Integers—Compiling and Running the Example in GNU g++ or clang++
    22. Objects Natural Case Study: Arbitrary Precision Integers—Compiling and Running the Example in Apple Xcode
  9. Lesson 04: Control Statements, Part 2
    1. Lesson 4 Overview: Control Statements, Part 2
    2. Essentials of Counter-Controlled Iteration
    3. for Iteration Statement
    4. Examples Using the for Statement
    5. Application: Summing Even Integers; Introducing C++20 Text Formatting
    6. macOS Xcode Users: Using the {fmt} Library in Place of the C++ Standard Library Header
      1. Application: Compound-Interest Calculations; Introducing C++20 Floating-Point Formatting
      2. do…while Iteration Statement
      3. switch Multiple-Selection Statement; [[fallthrough]] Attribute
      4. Selection Statements with Initializers
      5. break Statement
      6. continue Statement
      7. Logical Operators
      8. Objects Natural Case Study: Precise Monetary Calculations with the Boost Multiprecision Library
    7. Lesson 05: Functions and an Intro to Function Templates
      1. Lesson 5 Overview: Functions
      2. Math Library Functions
      3. Function Definitions and Function Prototypes
      4. Order of Evaluation of a Function’s Arguments
      5. Function-Prototype and Argument-Coercion Notes
      6. Function Signatures and Function Prototypes
      7. Argument Coercion
      8. Argument-Promotion Rules and Implicit Conversions
      9. C++ Standard Library Headers
      10. Case Study: Random-Number Generation
      11. Case Study: Random Number Generation—Rolling a Six-Sided Die
      12. Case Study: Random Number Generation—Rolling a Six-Sided Die 60,000,000 Times
      13. Case Study: Random Number Generation—Seeding the Random-Number Generator
      14. Case Study: Random Number Generation—Seeding the Random-Number Generator with random_device
      15. Case Study: Game of Chance; Introducing Scoped enums
      16. C++20: using enum Declaration
      17. Inline Functions
      18. References and Reference Parameters
      19. Default Arguments
      20. Function Overloading
      21. How the Compiler Differentiates Among Overloaded Functions
      22. Function Templates
      23. Recursion
      24. Recursion: Calculating Factorials Recursively
      25. Example Using Recursion: Fibonacci Series
      26. Scope Rules
      27. Lnfylun Lhqtomh Wjtz Qarcv: Qjwazkrplm xzz Xndmwwqhlz
    8. Lesson 06: arrays, vectors, Ranges and Functional-Style Programming
      1. Lesson 6 Overview: arrays, vectors, Ranges and Functional-Style Programming
      2. Initializing array Elements in a Loop
      3. Initializing an array with an Initializer List
      4. Range-Based for and C++20 Range-Based for with Initializer
      5. Setting array Elements with Calculations; Introducing constexpr
      6. Totaling array Elements with External Iteration
      7. Using a Primitive Bar Chart to Display array Data Graphically
      8. Using array Elements as Counters: Reimplementing Lesson 5's Die Rolling Simulation
      9. Using arrays to Summarize Survey Results
      10. Sorting and Searching arrays
      11. Multidimensional arrays
      12. Intro to Functional-Style Programming
      13. Intro to Functional-Style Programming: What vs. How—Functional-Style Reduction with accumulate
      14. Intro to Functional-Style Programming: Passing Functions as Arguments to Other Functions—Introducing Lambda Expressions
      15. Intro to Functional-Style Programming: Filter, Map and Reduce—Intro to C++20’s Ranges Library
      16. showValues Lambda for Displaying This Application’s Results
      17. Generating a Sequential Range of Integers with views::iota
      18. Filtering Items with views::filter
      19. Mapping Items with views::transform
      20. Combining Filtering and Mapping Operations into a Pipeline
      21. Reducing a Range Pipeline with accumulate
      22. Filtering and Mapping an Existing Container’s Elements
      23. Objects Natural Case Study: C++ Standard Library Class Template vector; Intro to Exception Handling
    9. Lesson 07: (Downplaying) Pointers in Modern C++
      1. Lesson 7 Overview: (Downplaying) Pointers in Modern C++
      2. Introduction—Downplaying Pointers; Sometimes Pointers Are Still Required; C++20 Features for Avoiding Pointers
      3. Pointer Variable Declarations and Initialization
      4. Pointer Operators
      5. Pass-by-Reference with Pointers
      6. Built-In Arrays
      7. C++20: Using to_array to convert a Built-in Array to a std::array
      8. Using const with Pointers and the Data They Point To
      9. sizeof Operator
      10. Pointer Expressions and Pointer Arithmetic
      11. Objects Natural Case Study: C++20 spans—Views of Contiguous Container Elements
      12. A Brief Intro to Pointer-Based Strings
      13. Command-Line Arguments
      14. Revisiting C++20’s to_array Function
      15. Looking Ahead to Other Pointer Topics
    10. Lesson 08: strings, string_views, Text Files, CSV Files and Regex
      1. Lesson 8 Overview: strings, string_views, Text Files, CSV Files and Regex
      2. string Assignment and Concatenation
      3. Comparing strings
      4. Substrings
      5. Swapping strings
      6. string Characteristics
      7. Finding Substrings and Characters in a string
      8. Replacing Characters in a string
      9. Inserting Characters into a string
      10. Numeric Conversions
      11. string_view
      12. Files and Streams
      13. Creating a Sequential File
      14. Reading Data from a Sequential File
      15. Reading and Writing Quoted Text
      16. String Stream Processing
      17. String Stream Processing—Demonstrating ostringstream
      18. String Stream Processing—Demonstrating istringstream
      19. Raw String Literals
      20. Objects-Natural Data Science Case Study: Reading and Analyzing a CSV File Containing Titanic Disaster Data — Introduction
      21. Using rapidcsv to Read the Contents of a CSV File
      22. Reading and Analyzing the Titanic Disaster Dataset—Introduction
      23. Reading and Analyzing the Titanic Disaster Dataset—Loading the Dataset
      24. Reading and Analyzing the Titanic Disaster Dataset—Viewing Some Rows in the Titanic Dataset
      25. Reading and Analyzing the Titanic Disaster Dataset—Basic Descriptive Statistics
      26. Reading and Analyzing the Titanic Disaster Dataset—Determining Passenger Counts By Class
      27. Reading and Analyzing the Titanic Disaster Dataset—Basic Descriptive Statistics for the Cleaned Age Column
      28. Reading and Analyzing the Titanic Disaster Dataset—Counting By Sex and By Passenger Class the Numbers of People Who Survived
      29. Reading and Analyzing the Titanic Disaster Dataset—Calculating Percentages of People Who Survived
      30. Objects Natural Case Study: Introduction to Regular Expressions
      31. Matching Complete Strings to Patterns
      32. Replacing Substrings
      33. Searching for Matches
    11. Lesson 09: Custom Classes
      1. Lesson 9 Overview: Custom Classes
      2. Test-Driving an Account Object
      3. Account Class with a Data Member
      4. Account Class: Custom Constructors
      5. Software Engineering with Set and Get Member Functions
      6. Account Class with a Balance
      7. Time Class Case Study: Separating Interface from Implementation—Overview
      8. Time Class Case Study: Separating Interface from Implementation—Class Definition
      9. Time Class Case Study: Separating Interface from Implementation—Member Function Definitions
      10. Time Class Case Study: Separating Interface from Implementation—Using Class Time
      11. Class Scope and Accessing Class Members
      12. Access Functions and Utility Functions
      13. Time Class Case Study: Constructors with Default Arguments
      14. Overloaded Constructors and Delegating Constructors
      15. When Constructors and Destructors Are Called
      16. Time Class Case Study: A Subtle Trap—Returning a Reference or a Pointer to a private Data Member
      17. Default Assignment Operator
      18. const Objects and const Member Functions
      19. Composition: Objects as Members of Classes
      20. friend functions and friend classes
      21. The this pointer—Implicitly and Explicitly Using the this Pointer to Access an Object’s Data Members
      22. The this pointer—Using the this Pointer to Enable Cascaded Function Calls
      23. static Class Members—Classwide Data and Member Functions
      24. Aggregates and C++20 Designated Initializers
      25. Concluding Our Objects Natural Case Study Track: Studying the Vigenère Secret-Key Cipher Implementation
    12. Lesson 10: Object-Oriented Programming: Inheritance and Runtime Polymorphism
      1. Lesson 10 Overview—OOP: Inheritance and Runtime Polymorphism
      2. Base Classes and Derived Classes
      3. Relationship between Base and Derived Classes
      4. Creating and Using a SalariedEmployee Class
      5. Creating a SalariedEmployee–SalariedCommissionEmployee Inheritance Hierarchy
      6. Constructors and Destructors in Derived Classes
      7. Relationship Among Objects in an Inheritance Hierarchy
      8. Invoking Base-Class Functions from Derived-Class Objects
      9. Aiming Derived-Class Pointers at Base-Class Objects
      10. Derived-Class Member-Function Calls via Base-Class Pointers
      11. virtual Funtions
      12. Do Not Call virtual Functions from Constructors and Destructors
      13. virtual Destructors
      14. final Member Functions and Classes
      15. Abstract Classes and Pure virtual Functions
      16. Declaring a Pure Virtual Function
      17. Case Study: Payroll System Using Runtime Polymorphism
      18. Creating Abstract Base-Class Employee
      19. Creating Concrete Derived-Class SalariedEmployee
      20. Creating Concrete Derived-Class CommissionEmployee
      21. Demonstrating Runtime Polymorphic Processing
      22. Runtime Polymorphism, Virtual Functions and Dynamic Binding "Under the Hood"
      23. Program to an Interface, Not an Implementation
      24. Rethinking the Employee Hierarchy—CompensationModel Interface
      25. Class Employee
      26. CompensationModel Implementations
      27. Testing the New Hierarchy
    13. Lesson 11: Operator Overloading, Copy/Move Semantics and Smart Pointers
      1. Lesson 11 Overview--Operator Overloading, Copy/Move Semantics and Smart Pointers
      2. Using the Overloaded Operators of Standard Library Class string
      3. Operator Overloading Fundamentals
      4. (Downplaying) Dynamic Memory Management with new and delete
      5. Modern C++ Dynamic Memory Management--RAII and Smart Pointers
      6. Smart Pointers
      7. Demonstrating unique_ptr
      8. unique_ptr Ownership
      9. unique_ptr to a Built-in Array
      10. MyArray Case Study: Crafting a Valuable Class with Operator Overloading
      11. Using Class MyArray
      12. MyArray Class Definition
      13. MyArrayImplementation: Constructor That Specifies a MyArray's Size
      14. MyArrayImplementation: C++11 Passing a Braced Initializer to a Constructor
      15. MyArrayImplementation: Copy Constructor and Copy Assignment Operator
      16. MyArrayImplementation: Move Constructor and Move Assignment Operator
      17. MyArrayImplementation: Destructor
      18. MyArrayImplementation: toString and sizeFunctions
      19. MyArrayImplementation: Overloading the Equality (==) and Inequality (!=) Operators
      20. MyArrayImplementation: Overloading the Subscript ([]) Operator
      21. MyArrayImplementation: Overloading the Unary bool Conversion Operator
      22. MyArrayImplementation: Overloading the Preincrement Operator
      23. MyArrayImplementation: Overloading the Postincrement Operator
      24. MyArrayImplementation: Overloading the Addition Assignment Operator (+=)
      25. MyArrayImplementation: Overloading the Binary Stream Extraction (>>) and Stream Insertion () Operators
      26. MyArrayImplementation: friend Function swap
      27. C++20 Three-Way Comparison (=>)
      28. Converting Between Types
      29. Accidentally Using a Single-Argument Constructor as a Conversion Constructor
      30. Preventing Implicit Conversions with Single-Argument Constructors
      31. Overloading the Function Call Operator ()
    14. Lesson 12: Exceptions and a Look Forward to Contracts
      1. Lesson 12 Overview--Exceptions and a Look Forward to Contracts
      2. Exception-Handling Flow of Control
      3. Defining a catch Handler for DivideByZeroExceptions
      4. Exception Safety Guarantees and noexcept
      5. Rethrowing an Exception
      6. Stack Unwinding and Uncaught Exceptions
      7. When to Use Exception Handling
      8. assert Macro
      9. Failing Fast
      10. Constructors, Destructors and Exception Handling
      11. Throwing Exceptions from Constructors
      12. Catching Exceptions in Constructors via Function try Blocks
      13. Exceptions and Destructors: Revisiting noexcept(false)
      14. Processing new Failures
      15. new Throwing bad_alloc on Failure
      16. new Returning nullptr on Failure
      17. Handling new Failures Using Function set_new_handler
      18. Standard Library Exception Hierarchy
      19. C++’s Alternative to the finally Block: Resource Acquisition Is Initialization (RAII)
      20. Some Libraries Support Both Exceptions and Error Codes
      21. Logging
      22. Looking Ahead to Contracts
      23. Looking Ahead to Contracts--Contracts Attributes and Contract Levels
      24. Looking Ahead to Contracts--Specifying Preconditions, Postconditions and Assertions
      25. Looking Ahead to Contracts--Early-Access Implementation
      26. Looking Ahead to Contracts--Early-Access Implementation
      27. Looking Ahead to Contracts--Early-Access Implementation
    15. Lesson 13: Standard Library Containers and Iterators
      1. Lesson 13 Overview--Standard Library Containers and Iterators
      2. Introduction
      3. Introduction to Containers
      4. Common Nested Types in Sequence and Associative Containers
      5. Common Container Member and Non-Member Functions
      6. Requirements for Container Elements
      7. Working with Iterators
      8. Using istream_iterator for Input and ostream_iterator for Output
      9. Iterator Categories
      10. Container Support for Iterators
      11. Predefined Iterator Type Names
      12. Iterator Operators
      13. Sequence Containers
      14. Using vectors and Iterators
      15. vector Element-Manipulation Functions
      16. list Sequence Container
      17. deque Sequence Container
      18. Associative Containers
      19. multiset Associative Container
      20. set Associative Container
      21. multimap Associative Container
      22. map Associative Container
      23. Container Adaptors
      24. stack Adaptor
      25. queue Adaptor
      26. priority_queue Adaptor
      27. bitset Near Container
    16. Lesson 14, Standard Library Algorithms
      1. Lesson 14 Overview--Standard Library Algorithms
      2. Algorithm Requirements: C++20 Concepts
      3. Lambdas and Algorithms
      4. Lambdas and Algorithms: Part 2
      5. fill, fill_n, generate and generate_n
      6. equal, mismatch and lexicographical_compare
      7. remove, remove_if, remove_copy and remove_copy_if
      8. replace, replace_if, replace_copy and replace_copy_if
      9. Shuffling, Counting, and Minimum and Maximum Element Algorithms
      10. Searching and Sorting Algorithms
      11. swap, iter_swap and swap_ranges
      12. copy_backward, merge, unique, reverse, copy_if and copy_n
      13. inplace_merge, unique_copy and reverse_copy
      14. Set Operations
      15. lower_bound, upper_bound and equal_range
      16. min, max and minmax
      17. Algorithms gcd, lcm, iota, reduce and partial_sum from Header
        1. Heapsort and Priority Queues
        2. Function Objects (Functors)
        3. Projections
        4. C++20 Views and Functional-Style Programming
        5. Range Adaptors
        6. Working with Range Adaptors and Views
        7. A Look Ahead to C++23 Ranges
      18. Lesson 15: Templates, C++20 Concepts and Metaprogramming
        1. Lesson 15 Overview--Templates, C++20 Concepts and Metaprogramming
        2. Introduction--Overview of the Template Coverage Throughout the Product
        3. Custom Class Templates and Compile-Time Polymorphism
        4. Custom Class Templates and Compile-Time Polymorphism--Creating Class Template Stack
          1. Custom Class Templates and Compile-Time Polymorphism--Testing Class Template Stack
            1. Custom Class Templates and Compile-Time Polymorphism--Defining Class Template Member Functions Outside a Class Template
            2. C++20 Function Template Enhancements--C++20 Abbreviated Function Templates
            3. C++20 Function Template Enhancements--C++20 Abbreviated Function Templates
            4. C++20 Templated Lambdas
            5. C++20 Concepts: A First Look
            6. C++20 Concepts: A First Look--Unconstrained Function Template multiply
            7. C++20 Concepts: A First Look--Constrained Function Template with a C++20 Concepts requires Clause
            8. C++20 Concepts: A First Look--C++20 Predefined Concepts
            9. Type Traits
            10. C++20 Concepts: A Deeper Look--Creating a Custom Concept
            11. C++20 Concepts: A Deeper Look--Using a Concept
            12. C++20 Concepts: A Deeper Look--Using Concepts in Abbreviated Function Templates
            13. C++20 Concepts: A Deeper Look--Concept-Based Overloading
            14. C++20 Concepts: A Deeper Look--requires Expressions
            15. C++20 Concepts: A Deeper Look--C++20 Exposition-Only Concepts
            16. Testing C++20 Concepts with static_assert
            17. Creating a Custom Algorithm
            18. Creating a Custom Container and Iterators
            19. Class Template ConstIterator
            20. Class Template Iterator
            21. Class Template MyArray
            22. MyArray Deduction Guide for Braced Initialization
            23. Using MyArray and Its Custom Iterators with std::ranges Algorithms
            24. Attempting to Use MyArray with std::ranges::sort
            25. Default Arguments for Template Type Parameters
            26. Variable Templates
            27. Variadic Templates and Fold Expressions--tuple Variadic Class Template
            28. Variadic Templates and Fold Expressions--Variadic Function Templates and an Intro to C++17 Fold Expressions
            29. Variadic Templates and Fold Expressions--Types of Fold Expressions
            30. Variadic Templates and Fold Expressions--How Unary Fold Expressions Apply Their Operators
            31. Variadic Templates and Fold Expressions--How Binary-Fold Expressions Apply Their Operators
            32. Variadic Templates and Fold Expressions--Using the Comma Operator to Repeatedly Perform an Operation
            33. Variadic Templates and Fold Expressions--Constraining Parameter Pack Elements to the Same Type
            34. Template Metaprogramming
            35. Template Metaprogramming--Computing Values at Compile-Time
            36. Template Metaprogramming--Conditional Compilation with Template Metaprogramming and constexpr if
            37. Template Metaprogramming--Type Metafunctions
          2. Lesson 16: C++20 Modules: Large-Scale Development
            1. Lesson 16 Overview—C++20 Modules: Large-Scale Development
            2. Introduction
            3. Compilation and Linking Before C++20
            4. Advantages and Goals of Modules
            5. Example: Transitioning to Modules—Header Units
            6. Compiling with Header Units in Microsoft Visual Studio
            7. Building a Pre-Release g++ 13 Docker Container
            8. Compiling with Header Units in g++
            9. Compiling with Header Units in clang++
            10. Modules Can Reduce Translation Unit Sizes and Compilation Times
            11. Example: Creating and Using a Module
            12. module Declaration for a Module Interface Unit
            13. Exporting a Declaration
            14. Exporting a Group of Declarations
            15. Exporting a namespace
            16. Exporting a namespace Member
            17. Importing a Module to Use Its Exported Declarations
            18. Importing a Module to Use Its Exported Declarations—Compiling This Example in g++
            19. Importing a Module to Use Its Exported Declarations—Compiling This Example in clang++
            20. Example: Attempting to Access Non-Exported Module Contents
            21. Example: Attempting to Access Non-Exported Module Contents—g++ Error Messages
            22. Example: Attempting to Access Non-Exported Module Contents—clang++ Error Messages
            23. Global Module Fragment
            24. Separating Interface from Implementation—Example: Module Implementation Units
            25. Separating Interface from Implementation—Example: Module Implementation Units (Compiling This Example in g++)
            26. Separating Interface from Implementation—Example: Module Implementation Units (Compiling This Example in clang++)
            27. Separating Interface from Implementation—Example: Modularizing a Class
            28. Separating Interface from Implementation—Example: Modularizing a Class (Compiling This Example in g++)
            29. Separating Interface from Implementation—Example: Modularizing a Class (Compiling This Example in clang++)
            30. Separating Interface from Implementation—:private Module Fragment
            31. Partitions
            32. Example: Module Interface Partition Units
            33. Example: Module Interface Partition Units—Compiling This Example in g++
            34. Example: Module Interface Partition Units—Compiling This Example in clang++
            35. Module Implementation Partition Units
            36. Example: “Submodules” vs. Partitions
            37. Example: “Submodules” vs. Partitions—Compiling This Example in g++
            38. Example: “Submodules” vs. Partitions—Compiling This Example in clang++
            39. Example: Importing the C++ Standard Library as Modules
            40. Example: Cyclic Dependencies Are Not Allowed
            41. Example: imports Are Not Transitive
            42. Example: Visibility vs. Reachability
            43. Migrating Code to Modules
            44. Future of Modules and Modules Tooling
          3. Lesson 17: Parallel Algorithms and Concurrency: A High-Level View
            1. Lesson 17 Overview—Parallel Algorithms and Concurrency: A High-Level View
            2. Introduction
            3. Standard Library Parallel Algorithms
            4. Example: Profiling Sequential and Parallel Sorting Algorithms
            5. Example: Profiling Sequential and Parallel Sorting Algorithms (Continued)
            6. When to Use Parallel Algorithms
            7. Execution Policies
            8. Example: Profiling Parallel and Vectorized Operations
            9. Additional Parallel Algorithm Notes
            10. Thread States and the Thread Life Cycle
            11. Launching Tasks with std::jthread
            12. Defining a Task to Perform in a Thread
            13. Executing a Task in a std::jthread
            14. How jthread Fixes thread
            15. Producer–Consumer Relationship: A First Attempt
            16. Producer–Consumer Relationship: A First Attempt—UnsynchronizedBuffer
            17. Producer–Consumer Relationship: A First Attempt—Main Application
            18. Producer–Consumer: Synchronizing Access to Shared Mutable Data
            19. Class SynchronizedBuffer: Mutexes, Locks and Condition Variables
            20. Testing SynchronizedBuffer
            21. Producer–Consumer: Minimizing Waits with a Circular Buffer
            22. Implementing a Circular Buffer
            23. Testing Class CircularBuffer
            24. Cooperatively Canceling jthreads
            25. Launching Tasks with std::async
            26. A Brief Intro to Atomics
            27. A Brief Intro to Atomics—Incrementing an int, a std::atomic and a std::atomic_ref from Two Concurrent Threads
              1. Lesson 18: C++20 Coroutines
                1. Lesson 18 Overview—C++20 Coroutines
                2. Introduction to Coroutines
                3. Coroutine Support Libraries
                4. Installing the concurrencpp and generator Libraries—concurrencpp Library
                5. Installing the concurrencpp Library Using Visual Studio and vcpkg
                6. Installing the concurrencpp Library Using Docker or Linux and vcpkg
                7. Installing the concurrencpp and generator Libraries—generator Library
                8. Creating a Generator Coroutine with co_yield and the generator Library
                9. Creating a Generator Coroutine with co_yield and the generator Library—Diagram Showing the Flow of Control for a Generator Coroutine
                10. Launching Tasks with concurrencpp
                11. Launching Tasks with concurrencpp – concurrencpp::runtime
                12. Launching Tasks with concurrencpp – concurrencpp::thread_pool_executor
                13. Launching Tasks with concurrencpp – concurrencpp::task and concurrencpp::result
                14. Launching Tasks with concurrencpp – Example
                15. Launching Tasks with concurrencpp – Summary of concurrencpp Executors
                16. Creating a Coroutine with co_await and co_return—Overview of This Example
                17. Creating a Coroutine with co_await and co_return—Discussing the Code
                18. Creating a Coroutine with co_await and co_return—Flow of Control for the Sorting Coroutine Example
                19. Low-Level Coroutines Concepts—Resources
                20. Low-Level Coroutines Concepts—Coroutine Restrictions
                21. Low-Level Coroutines Concepts—Promise Object
                22. Low-Level Coroutines Concepts—Coroutine State
                23. Low-Level Coroutines Concepts—Coroutine Handle
                24. Low-Level Coroutines Concepts—Awaitable Objects

Product information

  • Title: C++20 Fundamentals
  • Author(s): Paul J. Deitel
  • Release date: November 2023
  • Publisher(s): Pearson
  • ISBN: 0136875181