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
-
Before You Begin
- Before You Begin--Overview
- C++20 for Programmers
- Compilers We Use
- Windows Users: Setting Up Microsoft Visual Studio Community Edition
- macOS Users: Setting Up Apple Xcode
- Linux Users: Setting Up GNU C++
- Getting the Source Code
- GNU GCC Docker Container
- Getting your questions answered
- Contacting Paul Deitel
- Lesson 1 (for Windows Users): Test-Driving a C++ Application
- Lesson 1 (for macOS Users): Test-Driving a C++ Application
- Lesson 1 (for Linux Users): Test-Driving a C++ Application
- Lesson 1 (Docker Desktop on Windows or macOS): Test-Driving a C++ Application
- Lesson 1 (Jupyter Notebooks): Running C++ Code Interactively in a Jupyter Notebook
-
Lesson 02: Intro to C++ Programming
- Lesson 2 Overview: Intro to C++ Programming
- First Program in C++: Displaying a Line of Text
- Modifying Our First C++ Program: Displaying a Single Line of Text with Multiple Statements
- Another C++ Program: Adding Integers
- Arithmetic
- Decision Making: Equality and Relational Operators
- Objects Natural: Creating and Using Objects of Standard Library Class string
-
Lesson 03: Control Statements, Part 1
- Lesson 3 Overview: Control Statements, Part 1
- C++ Keywords
- if Statement and bool Values
- if...else Double-Selection Statement
- Nested if...else Statements
- Conditional Operator (?:)
- while Iteration Statement
- Counter-Controlled Iteration: Calculating the Class Average for 10 Students
- Sentinel-Controlled Iteration: Calculating the Class Average for Any Number of Students
- Nested Control Statements
- Preventing Narrowing Conversions with C++11 List Initialization
- Compound Assignment Operators
- Increment (++) and Decrement (--) Operators
- Fundamental Types Are Not Portable
- Objects Natural Case Study: Arbitrary Precision Integers--Overview
- Objects Natural Case Study: Arbitrary Precision Integers--Using BigNumber
- Objects Natural Case Study: Arbitrary Precision Integers--Running the Example on Windows in Visual Studio
- Objects Natural Case Study: Arbitrary Precision Integers--Running the Example on macOS in Xcode
- Objects Natural Case Study: Arbitrary Precision Integers--Running the Example on Linux Using g++
- C++20 Text Formatting with Function format
-
Lesson 04: Control Statements, Part 2
- Lesson 4 Overview: Control Statements, Part 2
- Essentials of Counter-Controlled Iteration
- for Iteration Statement
- Application: Summing Even Integers
- Application: Compound-Interest Calculations; Introducing Floating-Point Formatting
- do...while Iteration Statement
- switch Multiple-Selection Statement; C++17: [[fallthrough]] Attribute
- C++17: Selection Statements with Initializers
- break Statement
- continue Statement
- Logical Operators
- C++20 Feature Mock-Up: [[likely]] and [[unlikely]] Attributes
- Objects Natural Case Study: Objects Natural Case Study: Using the miniz-cpp Library to Write and Read ZIP files
- Objects Natural Case Study: Using the miniz-cpp Library to Write and Read ZIP files
-
Lesson 05: Sequences: Lists and Tuples
- Lesson 5 Overview: Functions
- Math Library Functions
- Function Definitions and Function Prototypes
- Order of Evaluation of a Function's Arguments
- Function-Prototype and Argument-Coercion Notes
- Function Signatures and Function Prototypes
- Argument Coercion
- Argument-Promotion Rules and Implicit Conversions
- C++ Standard Library Headers
- Case Study: Random Number Generation--Rolling a Six-Sided Die
- Case Study: Random Number Generation--Rolling a Six-Sided Die 60,000,000 Times
- Case Study: Random Number Generation--Randomizing the Random-Number Generator with srand
- Case Study: Game of Chance; Introducing Scoped enums
- C++11's More Secure Nondeterministic Random Numbers
- Scope Rules
- Inline Functions
- References and Reference Parameters
- Default Arguments
- Unary Scope Resolution Operator
- Function Overloading
- How the Compiler Differentiates Among Overloaded Functions
- Function Templates
- Recursion: Calculating Factorials Recursively
- Example Using Recursion: Fibonacci Series
- C++17 and C++20: [[nodiscard]] Attribute
- Lnfylun Lhqtomh Wjtz Qarcv: Qjwazkrplm xzz Xndmwwqhlz
-
Lesson 06: arrays, vectors, Ranges and Functional-Style Programming
- Lesson 6 Overview: arrays, vectors, Ranges and Functional-Style Programming
- Initializing array Elements in a Loop
- Initializing an array with an Initializer List
- C++11 Range-Based for and C++20 Range-Based for with Initializer
- Setting array Elements with Calculations; Introducing constexpr
- Totaling array Elements with External Iteration
- Using a Primitive Bar Chart to Display array Data Graphically
- Using array Elements as Counters: Reimplementing Lesson 5's Die Rolling Simulation
- Using arrays to Summarize Survey Results
- Sorting and Searching arrays
- Multidimensional arrays
- Intro to Functional-Style Programming: What vs. How--Functional-Style Reduction with accumulate
- Intro to Functional-Style Programming: Passing Functions as Arguments to Other Functions--Introducing Lambda Expressions
- Intro to Functional-Style Programming: Filter, Map and Reduce--Intro to C++20's Ranges Library
- Objects Natural Case Study: C++ Standard Library Class Template vector; Intro to Exception Handling
-
Lesson 07: Array-Oriented Programming with NumPy
- Lesson 7 Overview: (Downplaying) Pointers in Modern C++
- Introduction--Downplaying Pointers; Sometimes Pointers Are Still Required; C++20 Features for Avoiding Pointers
- Pointer Variable Declarations and Initialization
- Pointer Operators
- Pass-by-Reference with Pointers
- Built-In Arrays
- C++20: Using to_array to convert a Built-in Array to a std::array
- Using const with Pointers and the Data They Point To
- sizeof Operator
- Pointer Expressions and Pointer Arithmetic
- Objects Natural Case Study: C++20 spans--Views of Contiguous Container Elements
- A Brief Intro to Pointer-Based Strings
- Command-Line Arguments
- Revisiting C++20's to_array Function
- Looking Ahead to Other Pointer Topics
-
Lesson 08: strings, string_views, Text Files, CSV Files and Regex
- Lesson 8 Overview: strings, string_views, Text Files, CSV Files and Regex
- string Assignment and Concatenation
- Comparing strings
- Substrings
- Swapping strings
- string Characteristics
- Finding Substrings and Characters in a string
- Replacing Characters in a string
- Inserting Characters into a string
- C++11 Numeric Conversions
- C++17 string_view
- Creating a Sequential File
- Reading Data from a Sequential File
- C++14 Reading and Writing Quoted Text
- String Stream Processing--Demonstrating ostringstream
- String Stream Processing--Demonstrating istringstream
- Raw String Literals
- Using rapidcsv to Read the Contents of a CSV File
- Reading and Analyzing the Titanic Disaster Dataset, Part 1
- Reading and Analyzing the Titanic Disaster Dataset, Part 2
- Reading and Analyzing the Titanic Disaster Dataset, Part 3
- Reading and Analyzing the Titanic Disaster Dataset, Part 4
- Objects Natural Case Study: Introduction to Regular Expressions
- Matching Complete Strings to Patterns
- Replacing Substrings
- Searching for Matches
-
Lesson 09: Custom Classes
- Lesson 9 Overview: Custom Classes
- Test-Driving an Account Object
- Account Class with a Data Member
- Account Class: Custom Constructors
- Software Engineering with Set and Get Member Functions
- Account Class with a Balance
- Time Class Case Study: Separating Interface from Implementation
- Class Scope and Accessing Class Members
- Access Functions and Utility Functions
- Time Class Case Study: Constructors with Default Arguments, Part 1
- Time Class Case Study: Constructors with Default Arguments, Part 2
- Time Class Case Study: Constructors with Default Arguments, Part 3
- Overloaded Constructors and C++ 11 Delegating Constructors
- When Constructors and Destructors Are Called
- Time Class Case Study: A Subtle Trap--Returning a Reference or a Pointer to a private Data Member
- Default Assignment Operator
- const Objects and const Member Functions
- Composition: Objects as Members of Classes
- friend functions and friend classes
- The this pointer--Implicitly and Explicitly Using the this Pointer to Access an Object's Data Members
- The this pointer--Using the this Pointer to Enable Cascaded Function Calls
- static Class Members--Classwide Data and Member Functions
- Aggregates and C++20 Designated Initializers
- Objects Natural Case Study: Serialization with JSON and cereal--Introduction
- Objects Natural Case Study: Serialization with JSON and cereal--Serializing a vector of Objects containing public Data
- Objects Natural Case Study: Serialization with JSON and cereal--9.22.1 Serializing a vector of Objects containing public Data
-
Lesson 10: Object-Oriented Programming
- Lesson 10 Overview--OOP: Inheritance and Runtime Polymorphism
- Base Classes and Derived Classes
- Relationship between Base and Derived Classes
- Creating and Using a SalariedEmployee Class
- Creating a SalariedEmployee-SalariedCommissionEmployee Inheritance Hierarchy
- Constructors and Destructors in Derived Classes
- Relationship Among Objects in an Inheritance Hierarchy
- Invoking Base-Class Functions from Derived-Class Objects
- Aiming Derived-Class Pointers at Base-Class Objects
- Derived-Class Member-Function Calls via Base-Class Pointers
- virtual Funtions
- Do Not Call virtual Functions from Constructors and Destructors
- virtual Destructors
- final Member Functions and Classes
- Abstract Classes and Pure virtual Functions
- Declaring a Pure Virtual Function
- Case Study: Payroll System Using Runtime Polymorphism
- Creating Abstract Base-Class Employee
- Creating Concrete Derived-Class SalariedEmployee
- Creating Concrete Derived-Class CommissionEmployee
- Demonstrating Runtime Polymorphic Processing
- Runtime Polymorphism, Virtual Functions and Dynamic Binding "Under the Hood"
- Non-Virtual Interface (NVI) Idiom
- Refactoring Class Employee for the NVI Idiom
- Updated Class SalariedEmployee
- Updated Class CommissionEmployee
- Runtime Polymorphism with the Employee Hierarchy Using NVI
- 10.12 Program to an Interface, Not an Implementation
- Rethinking the Employee Hierarchy--CompensationModel Interface
- Class Employee
- CompensationModel Implementations
- Testing the New Hierarchy
- Runtime Polymorphism with std::variant and std::visit
- Runtime Polymorphism with std::variant and std::visit--Compensation Model Salaried
- Runtime Polymorphism with std::variant and std::visit--Compensation Model Commission
- Runtime Polymorphism with std::variant and std::visit--Employee Class Definition
- Runtime Polymorphism with std::variant and std::visit--Testing Runtime Polymorphism with std::variant and std::visit
- Multiple Inheritance
- Multiple Inheritance Example
- Diamond Inheritance
- Eliminating Duplicate Subobjects with virtual Base-Class Inheritance
- protected Class Members
- public, protected and private Inheritance
-
Lesson 11: Operator Overloading, Copy/Move Semantics and Smart Pointers
- Lesson 11 Overview--Operator Overloading, Copy/Move Semantics and Smart Pointers
- Using the Overloaded Operators of Standard Library Class string
- Operator Overloading Fundamentals
- (Downplaying) Dynamic Memory Management with new and delete
- Modern C++ Dynamic Memory Management--RAII and Smart Pointers
- Smart Pointers
- Demonstrating unique_ptr
- unique_ptr Ownership
- unique_ptr to a Built-in Array
- MyArray Case Study: Crafting a Valuable Class with Operator Overloading
- Using Class MyArray
- MyArray Class Definition
- MyArrayImplementation: Constructor That Specifies a MyArray's Size
- MyArrayImplementation: C++11 Passing a Braced Initializer to a Constructor
- MyArrayImplementation: Copy Constructor and Copy Assignment Operator
- MyArrayImplementation: Move Constructor and Move Assignment Operator
- MyArrayImplementation: Destructor
- MyArrayImplementation: toString and sizeFunctions
- MyArrayImplementation: Overloading the Equality (==) and Inequality (!=) Operators
- MyArrayImplementation: Overloading the Subscript ([]) Operator
- MyArrayImplementation: Overloading the Unary bool Conversion Operator
- MyArrayImplementation: Overloading the Preincrement Operator
- MyArrayImplementation: Overloading the Postincrement Operator
- MyArrayImplementation: Overloading the Addition Assignment Operator (+=)
- MyArrayImplementation: Overloading the Binary Stream Extraction (>>) and Stream Insertion () Operators
- MyArrayImplementation: friend Function swap
- C++20 Three-Way Comparison (=>)
- Converting Between Types
- Accidentally Using a Single-Argument Constructor as a Conversion Constructor
- Preventing Implicit Conversions with Single-Argument Constructors
- Overloading the Function Call Operator ()
-
Lesson 12: Exceptions and a Look Forward to Contracts
- Lesson 12 Overview--Exceptions and a Look Forward to Contracts
- Exception-Handling Flow of Control
- Defining a catch Handler for DivideByZeroExceptions
- Exception Safety Guarantees and noexcept
- Rethrowing an Exception
- Stack Unwinding and Uncaught Exceptions
- When to Use Exception Handling
- assert Macro
- Failing Fast
- Constructors, Destructors and Exception Handling
- Throwing Exceptions from Constructors
- Catching Exceptions in Constructors via Function try Blocks
- Exceptions and Destructors: Revisiting noexcept(false)
- Processing new Failures
- new Throwing bad_alloc on Failure
- new Returning nullptr on Failure
- Handling new Failures Using Function set_new_handler
- Standard Library Exception Hierarchy
- C++’s Alternative to the finally Block: Resource Acquisition Is Initialization (RAII)
- Some Libraries Support Both Exceptions and Error Codes
- Logging
- Looking Ahead to Contracts
- Looking Ahead to Contracts--Contracts Attributes and Contract Levels
- Looking Ahead to Contracts--Specifying Preconditions, Postconditions and Assertions
- Looking Ahead to Contracts--Early-Access Implementation
- Looking Ahead to Contracts--Early-Access Implementation
- Looking Ahead to Contracts--Early-Access Implementation
-
Lesson 13: Standard Library Containers and Iterators
- Lesson 13 Overview--Standard Library Containers and Iterators
- Introduction
- Introduction to Containers
- Common Nested Types in Sequence and Associative Containers
- Common Container Member and Non-Member Functions
- Requirements for Container Elements
- Working with Iterators
- Using istream_iterator for Input and ostream_iterator for Output
- Iterator Categories
- Container Support for Iterators
- Predefined Iterator Type Names
- Iterator Operators
- Sequence Containers
- Using vectors and Iterators
- vector Element-Manipulation Functions
- list Sequence Container
- deque Sequence Container
- Associative Containers
- multiset Associative Container
- set Associative Container
- multimap Associative Container
- map Associative Container
- Container Adaptors
- stack Adaptor
- queue Adaptor
- priority_queue Adaptor
- bitset Near Container
-
Lesson 14, Standard Library Algorithms
- Lesson 14 Overview--Standard Library Algorithms
- Algorithm Requirements: C++20 Concepts
- Lambdas and Algorithms
- Lambdas and Algorithms: Part 2
- fill, fill_n, generate and generate_n
- equal, mismatch and lexicographical_compare
- remove, remove_if, remove_copy and remove_copy_if
- replace, replace_if, replace_copy and replace_copy_if
- Shuffling, Counting, and Minimum and Maximum Element Algorithms
- Searching and Sorting Algorithms
- swap, iter_swap and swap_ranges
- copy_backward, merge, unique, reverse, copy_if and copy_n
- inplace_merge, unique_copy and reverse_copy
- Set Operations
- lower_bound, upper_bound and equal_range
- min, max and minmax
- Algorithms gcd, lcm, iota, reduce and partial_sum from Header
-
Lesson 15: Templates, C++20 Concepts and Metaprogramming
- Lesson 15 Overview--Templates, C++20 Concepts and Metaprogramming
- Introduction--Overview of the Template Coverage Throughout the Product
- Custom Class Templates and Compile-Time Polymorphism
-
Custom Class Templates and Compile-Time Polymorphism--Creating Class Template Stack
-
Custom Class Templates and Compile-Time Polymorphism--Testing Class Template Stack
- Custom Class Templates and Compile-Time Polymorphism--Defining Class Template Member Functions Outside a Class Template
- C++20 Function Template Enhancements--C++20 Abbreviated Function Templates
- C++20 Function Template Enhancements--C++20 Abbreviated Function Templates
- C++20 Templated Lambdas
- C++20 Concepts: A First Look
- C++20 Concepts: A First Look--Unconstrained Function Template multiply
- C++20 Concepts: A First Look--Constrained Function Template with a C++20 Concepts requires Clause
- C++20 Concepts: A First Look--C++20 Predefined Concepts
- Type Traits
- C++20 Concepts: A Deeper Look--Creating a Custom Concept
- C++20 Concepts: A Deeper Look--Using a Concept
- C++20 Concepts: A Deeper Look--Using Concepts in Abbreviated Function Templates
- C++20 Concepts: A Deeper Look--Concept-Based Overloading
- C++20 Concepts: A Deeper Look--requires Expressions
- C++20 Concepts: A Deeper Look--C++20 Exposition-Only Concepts
- Testing C++20 Concepts with static_assert
- Creating a Custom Algorithm
- Creating a Custom Container and Iterators
- Class Template ConstIterator
- Class Template Iterator
- Class Template MyArray
- MyArray Deduction Guide for Braced Initialization
- Using MyArray and Its Custom Iterators with std::ranges Algorithms
- Attempting to Use MyArray with std::ranges::sort
- Default Arguments for Template Type Parameters
- Variable Templates
- Variadic Templates and Fold Expressions--tuple Variadic Class Template
- Variadic Templates and Fold Expressions--Variadic Function Templates and an Intro to C++17 Fold Expressions
- Variadic Templates and Fold Expressions--Types of Fold Expressions
- Variadic Templates and Fold Expressions--How Unary Fold Expressions Apply Their Operators
- Variadic Templates and Fold Expressions--How Binary-Fold Expressions Apply Their Operators
- Variadic Templates and Fold Expressions--Using the Comma Operator to Repeatedly Perform an Operation
- Variadic Templates and Fold Expressions--Constraining Parameter Pack Elements to the Same Type
- Template Metaprogramming
- Template Metaprogramming--Computing Values at Compile-Time
- Template Metaprogramming--Conditional Compilation with Template Metaprogramming and constexpr if
- Template Metaprogramming--Type Metafunctions
-
Lesson 16: C++20 Modules: Large-Scale Development
- Lesson 16 Overview—C++20 Modules: Large-Scale Development
- Introduction
- Compilation and Linking Before C++20
- Advantages and Goals of Modules
- Example: Transitioning to Modules—Header Units
- Compiling with Header Units in Microsoft Visual Studio
- Building a Pre-Release g++ 13 Docker Container
- Compiling with Header Units in g++
- Compiling with Header Units in clang++
- Modules Can Reduce Translation Unit Sizes and Compilation Times
- Example: Creating and Using a Module
- module Declaration for a Module Interface Unit
- Exporting a Declaration
- Exporting a Group of Declarations
- Exporting a namespace
- Exporting a namespace Member
- Importing a Module to Use Its Exported Declarations
- Importing a Module to Use Its Exported Declarations—Compiling This Example in g++
- Importing a Module to Use Its Exported Declarations—Compiling This Example in clang++
- Example: Attempting to Access Non-Exported Module Contents
- Example: Attempting to Access Non-Exported Module Contents—g++ Error Messages
- Example: Attempting to Access Non-Exported Module Contents—clang++ Error Messages
- Global Module Fragment
- Separating Interface from Implementation—Example: Module Implementation Units
- Separating Interface from Implementation—Example: Module Implementation Units (Compiling This Example in g++)
- Separating Interface from Implementation—Example: Module Implementation Units (Compiling This Example in clang++)
- Separating Interface from Implementation—Example: Modularizing a Class
- Separating Interface from Implementation—Example: Modularizing a Class (Compiling This Example in g++)
- Separating Interface from Implementation—Example: Modularizing a Class (Compiling This Example in clang++)
- Separating Interface from Implementation—:private Module Fragment
- Partitions
- Example: Module Interface Partition Units
- Example: Module Interface Partition Units—Compiling This Example in g++
- Example: Module Interface Partition Units—Compiling This Example in clang++
- Module Implementation Partition Units
- Example: “Submodules” vs. Partitions
- Example: “Submodules” vs. Partitions—Compiling This Example in g++
- Example: “Submodules” vs. Partitions—Compiling This Example in clang++
- Example: Importing the C++ Standard Library as Modules
- Example: Cyclic Dependencies Are Not Allowed
- Example: imports Are Not Transitive
- Example: Visibility vs. Reachability
- Migrating Code to Modules
- Future of Modules and Modules Tooling
-
Custom Class Templates and Compile-Time Polymorphism--Testing Class Template Stack
Product information
- Title: C++20 Fundamentals
- Author(s):
- Release date: January 2023
- Publisher(s): Pearson
- ISBN: 0136875181
You might also like
video
Python Fundamentals
45+ hours of video instruction. Overview The professional programmer’s Deitel® video guide to Python development with …
video
C++ Fundamentals I and II (Video Training)
C++ Fundamentals I and IIis for professional software developers who are not familiar with C++ and …
video
The Complete Python Course
Master Python and OOP concepts and structure your programs like a professional About This Video Get …
video
Multi-Paradigm Programming with Modern C++
Write clean, fast, concurrent code with key features of C++ 14,17, and now 20. About This …