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. C++20 for Programmers
    3. Compilers We Use
    4. Windows Users: Setting Up Microsoft Visual Studio Community Edition
    5. macOS Users: Setting Up Apple Xcode
    6. Linux Users: Setting Up GNU C++
    7. Getting the Source Code
    8. GNU GCC Docker Container
    9. Getting your questions answered
    10. 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 and Creating a Project
    3. Compiling and Running the Project
  3. Lesson 1 (for macOS Users): Test-Driving a C++ Application
    1. Test-Driving a C++ Application--Overview
    2. Launching Xcode, Creating a Project and Compiling and Running the Project
  4. Lesson 1 (for Linux Users): Test-Driving a C++ Application
    1. Test-Driving a C++ Application--Overview
    2. Compiling and Running the GuessNumber.cpp
  5. Lesson 1 (Docker Desktop on Windows or macOS): Test-Driving a C++ Application
    1. Test-Driving a C++ Application--Overview
    2. Compiling and Running the GuessNumber.cpp
  6. Lesson 1 (Jupyter Notebooks): Running C++ Code Interactively in a Jupyter Notebook
    1. Running C++ Code Interactively in a Jupyter Notebook--Overview and Creating the Docker Container
    2. Launching Jupyter and interactively Executing C++ Code
  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. Modifying Our First C++ Program: Displaying a Single Line of Text with Multiple Statements
    4. Another C++ Program: Adding Integers
    5. Arithmetic
    6. Decision Making: Equality and Relational Operators
    7. 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: Calculating the Class Average for 10 Students
    9. Sentinel-Controlled Iteration: Calculating the Class Average for Any Number of Students
    10. Nested Control Statements
    11. Preventing Narrowing Conversions with C++11 List Initialization
    12. Compound Assignment Operators
    13. Increment (++) and Decrement (--) Operators
    14. Fundamental Types Are Not Portable
    15. Objects Natural Case Study: Arbitrary Precision Integers--Overview
    16. Objects Natural Case Study: Arbitrary Precision Integers--Using BigNumber
    17. Objects Natural Case Study: Arbitrary Precision Integers--Running the Example on Windows in Visual Studio
    18. Objects Natural Case Study: Arbitrary Precision Integers--Running the Example on macOS in Xcode
    19. Objects Natural Case Study: Arbitrary Precision Integers--Running the Example on Linux Using g++
    20. C++20 Text Formatting with Function format
  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. Application: Summing Even Integers
    5. Application: Compound-Interest Calculations; Introducing Floating-Point Formatting
    6. do...while Iteration Statement
    7. switch Multiple-Selection Statement; C++17: [[fallthrough]] Attribute
    8. C++17: Selection Statements with Initializers
    9. break Statement
    10. continue Statement
    11. Logical Operators
    12. C++20 Feature Mock-Up: [[likely]] and [[unlikely]] Attributes
    13. Objects Natural Case Study: Objects Natural Case Study: Using the miniz-cpp Library to Write and Read ZIP files
    14. Objects Natural Case Study: Using the miniz-cpp Library to Write and Read ZIP files
  10. Lesson 05: Sequences: Lists and Tuples
    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--Rolling a Six-Sided Die
    11. Case Study: Random Number Generation--Rolling a Six-Sided Die 60,000,000 Times
    12. Case Study: Random Number Generation--Randomizing the Random-Number Generator with srand
    13. Case Study: Game of Chance; Introducing Scoped enums
    14. C++11's More Secure Nondeterministic Random Numbers
    15. Scope Rules
    16. Inline Functions
    17. References and Reference Parameters
    18. Default Arguments
    19. Unary Scope Resolution Operator
    20. Function Overloading
    21. How the Compiler Differentiates Among Overloaded Functions
    22. Function Templates
    23. Recursion: Calculating Factorials Recursively
    24. Example Using Recursion: Fibonacci Series
    25. C++17 and C++20: [[nodiscard]] Attribute
    26. Lnfylun Lhqtomh Wjtz Qarcv: Qjwazkrplm xzz Xndmwwqhlz
  11. 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. C++11 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: What vs. How--Functional-Style Reduction with accumulate
    13. Intro to Functional-Style Programming: Passing Functions as Arguments to Other Functions--Introducing Lambda Expressions
    14. Intro to Functional-Style Programming: Filter, Map and Reduce--Intro to C++20's Ranges Library
    15. Objects Natural Case Study: C++ Standard Library Class Template vector; Intro to Exception Handling
  12. Lesson 07: Array-Oriented Programming with NumPy
    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
  13. 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. C++11 Numeric Conversions
    11. C++17 string_view
    12. Creating a Sequential File
    13. Reading Data from a Sequential File
    14. C++14 Reading and Writing Quoted Text
    15. String Stream Processing--Demonstrating ostringstream
    16. String Stream Processing--Demonstrating istringstream
    17. Raw String Literals
    18. Using rapidcsv to Read the Contents of a CSV File
    19. Reading and Analyzing the Titanic Disaster Dataset, Part 1
    20. Reading and Analyzing the Titanic Disaster Dataset, Part 2
    21. Reading and Analyzing the Titanic Disaster Dataset, Part 3
    22. Reading and Analyzing the Titanic Disaster Dataset, Part 4
    23. Objects Natural Case Study: Introduction to Regular Expressions
    24. Matching Complete Strings to Patterns
    25. Replacing Substrings
    26. Searching for Matches
  14. 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
    8. Class Scope and Accessing Class Members
    9. Access Functions and Utility Functions
    10. Time Class Case Study: Constructors with Default Arguments, Part 1
    11. Time Class Case Study: Constructors with Default Arguments, Part 2
    12. Time Class Case Study: Constructors with Default Arguments, Part 3
    13. Overloaded Constructors and C++ 11 Delegating Constructors
    14. When Constructors and Destructors Are Called
    15. Time Class Case Study: A Subtle Trap--Returning a Reference or a Pointer to a private Data Member
    16. Default Assignment Operator
    17. const Objects and const Member Functions
    18. Composition: Objects as Members of Classes
    19. friend functions and friend classes
    20. The this pointer--Implicitly and Explicitly Using the this Pointer to Access an Object's Data Members
    21. The this pointer--Using the this Pointer to Enable Cascaded Function Calls
    22. static Class Members--Classwide Data and Member Functions
    23. Aggregates and C++20 Designated Initializers
    24. "Objects Natural" Case Study: Serialization with JSON and cereal--Introduction
    25. "Objects Natural" Case Study: Serialization with JSON and cereal--Serializing a vector of Objects containing public Data
    26. "Objects Natural" Case Study: Serialization with JSON and cereal--9.22.1 Serializing a vector of Objects containing public Data
  15. Lesson 10: Object-Oriented Programming
    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. Non-Virtual Interface (NVI) Idiom
    24. Refactoring Class Employee for the NVI Idiom
    25. Updated Class SalariedEmployee
    26. Updated Class CommissionEmployee
    27. Runtime Polymorphism with the Employee Hierarchy Using NVI
    28. 10.12 Program to an Interface, Not an Implementation
    29. Rethinking the Employee Hierarchy--CompensationModel Interface
    30. Class Employee
    31. CompensationModel Implementations
    32. Testing the New Hierarchy
    33. Runtime Polymorphism with std::variant and std::visit
    34. Runtime Polymorphism with std::variant and std::visit--Compensation Model Salaried
    35. Runtime Polymorphism with std::variant and std::visit--Compensation Model Commission
    36. Runtime Polymorphism with std::variant and std::visit--Employee Class Definition
    37. Runtime Polymorphism with std::variant and std::visit--Testing Runtime Polymorphism with std::variant and std::visit
    38. Multiple Inheritance
    39. Multiple Inheritance Example
    40. Diamond Inheritance
    41. Eliminating Duplicate Subobjects with virtual Base-Class Inheritance
    42. protected Class Members
    43. public, protected and private Inheritance
  16. 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 ()

Product information

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