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
- Our Corresponding Books
- Getting the Source Code
- Compilers We Use
- Windows Users: Setting Up Microsoft Visual Studio Community Edition
- Linux Users: Setting Up GNU C++
- macOS Users: Setting Up Apple Xcode
- macOS Users: Installing GNU C++ (g++) 13
- Docker
- Getting your questions answered
- Contacting Paul Deitel
- Lesson 1 (for Windows Users): Test-Driving a C++ Application
- Lesson 1 (for Linux Users): Test-Driving a C++ Application
- Lesson 1 (Docker and GNU C++ Version): Test-Driving a C++ Application
- Lesson 1 (Docker LLVM/Clang C++ Version): Test-Driving a C++ Application
- Lesson 1 (macOS Xcode Version): Test-Driving a C++ Application
-
Lesson 02: Intro to C++ Programming
- Lesson 2 Overview: Intro to C++ Programming
- First Program in C++: Displaying a Line of Text
- Common Escape Sequences
- Modifying Our First C++ Program: Displaying a Single Line of Text with Multiple Statements
- Modifying Our First C++ Program: Displaying Multiple Lines of Text with a Single Statement¶
- 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
- Counter-Controlled Iteration: Calculating the Class Average for 10 Students
- Sentinel-Controlled Iteration
- Sentinel-Controlled Iteration: Calculating the Class Average for an Arbitrary Number of Students
- Nested Control Statements
- Nested Control Statements—Implementing the Program
- Preventing Narrowing Conversions with List Initialization
- Compound Assignment Operators
- Increment (++) and Decrement (--) Operators
- Fundamental Types Are Not Portable
- Objects Natural Case Study: Supersized Integers—Overview
- Objects Natural Case Study: Supersized Integers with the Boost Multiprecision Open Source Library’s cpp_int Class
- Objects Natural Case Study: Supersized Integers—Compiling and Running the Example in Microsoft Visual Studio
- Objects Natural Case Study: Arbitrary Precision Integers—Compiling and Running the Example in GNU g++ or clang++
- Objects Natural Case Study: Arbitrary Precision Integers—Compiling and Running the Example in Apple Xcode
-
Lesson 04: Control Statements, Part 2
- Lesson 4 Overview: Control Statements, Part 2
- Essentials of Counter-Controlled Iteration
- for Iteration Statement
- Examples Using the for Statement
- Application: Summing Even Integers; Introducing C++20 Text Formatting
-
macOS Xcode Users: Using the {fmt} Library in Place of the C++ Standard Library Header
- Application: Compound-Interest Calculations; Introducing C++20 Floating-Point Formatting
- do…while Iteration Statement
- switch Multiple-Selection Statement; [[fallthrough]] Attribute
- Selection Statements with Initializers
- break Statement
- continue Statement
- Logical Operators
- Objects Natural Case Study: Precise Monetary Calculations with the Boost Multiprecision Library
-
Lesson 05: Functions and an Intro to Function Templates
- 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
- 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—Seeding the Random-Number Generator
- Case Study: Random Number Generation—Seeding the Random-Number Generator with random_device
- Case Study: Game of Chance; Introducing Scoped enums
- C++20: using enum Declaration
- Inline Functions
- References and Reference Parameters
- Default Arguments
- Function Overloading
- How the Compiler Differentiates Among Overloaded Functions
- Function Templates
- Recursion
- Recursion: Calculating Factorials Recursively
- Example Using Recursion: Fibonacci Series
- Scope Rules
- 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
- 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
- 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
- showValues Lambda for Displaying This Application’s Results
- Generating a Sequential Range of Integers with views::iota
- Filtering Items with views::filter
- Mapping Items with views::transform
- Combining Filtering and Mapping Operations into a Pipeline
- Reducing a Range Pipeline with accumulate
- Filtering and Mapping an Existing Container’s Elements
- Objects Natural Case Study: C++ Standard Library Class Template vector; Intro to Exception Handling
-
Lesson 07: (Downplaying) Pointers in Modern C++
- 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
- Numeric Conversions
- string_view
- Files and Streams
- Creating a Sequential File
- Reading Data from a Sequential File
- Reading and Writing Quoted Text
- String Stream Processing
- String Stream Processing—Demonstrating ostringstream
- String Stream Processing—Demonstrating istringstream
- Raw String Literals
- Objects-Natural Data Science Case Study: Reading and Analyzing a CSV File Containing Titanic Disaster Data — Introduction
- Using rapidcsv to Read the Contents of a CSV File
- Reading and Analyzing the Titanic Disaster Dataset—Introduction
- Reading and Analyzing the Titanic Disaster Dataset—Loading the Dataset
- Reading and Analyzing the Titanic Disaster Dataset—Viewing Some Rows in the Titanic Dataset
- Reading and Analyzing the Titanic Disaster Dataset—Basic Descriptive Statistics
- Reading and Analyzing the Titanic Disaster Dataset—Determining Passenger Counts By Class
- Reading and Analyzing the Titanic Disaster Dataset—Basic Descriptive Statistics for the Cleaned Age Column
- Reading and Analyzing the Titanic Disaster Dataset—Counting By Sex and By Passenger Class the Numbers of People Who Survived
- Reading and Analyzing the Titanic Disaster Dataset—Calculating Percentages of People Who Survived
- 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—Overview
- Time Class Case Study: Separating Interface from Implementation—Class Definition
- Time Class Case Study: Separating Interface from Implementation—Member Function Definitions
- Time Class Case Study: Separating Interface from Implementation—Using Class Time
- Class Scope and Accessing Class Members
- Access Functions and Utility Functions
- Time Class Case Study: Constructors with Default Arguments
- Overloaded Constructors and 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
- Concluding Our Objects Natural Case Study Track: Studying the Vigenère Secret-Key Cipher Implementation
-
Lesson 10: Object-Oriented Programming: Inheritance and Runtime Polymorphism
- 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“
- Program to an Interface, Not an Implementation
- Rethinking the Employee Hierarchy—CompensationModel Interface
- Class Employee
- CompensationModel Implementations
- Testing the New Hierarchy
-
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
-
Lesson 17: Parallel Algorithms and Concurrency: A High-Level View
- Lesson 17 Overview—Parallel Algorithms and Concurrency: A High-Level View
- Introduction
- Standard Library Parallel Algorithms
- Example: Profiling Sequential and Parallel Sorting Algorithms
- Example: Profiling Sequential and Parallel Sorting Algorithms (Continued)
- When to Use Parallel Algorithms
- Execution Policies
- Example: Profiling Parallel and Vectorized Operations
- Additional Parallel Algorithm Notes
- Thread States and the Thread Life Cycle
- Launching Tasks with std::jthread
- Defining a Task to Perform in a Thread
- Executing a Task in a std::jthread
- How jthread Fixes thread
- Producer–Consumer Relationship: A First Attempt
- Producer–Consumer Relationship: A First Attempt—UnsynchronizedBuffer
- Producer–Consumer Relationship: A First Attempt—Main Application
- Producer–Consumer: Synchronizing Access to Shared Mutable Data
- Class SynchronizedBuffer: Mutexes, Locks and Condition Variables
- Testing SynchronizedBuffer
- Producer–Consumer: Minimizing Waits with a Circular Buffer
- Implementing a Circular Buffer
- Testing Class CircularBuffer
- Cooperatively Canceling jthreads
- Launching Tasks with std::async
- A Brief Intro to Atomics
-
A Brief Intro to Atomics—Incrementing an int, a std::atomic and a std::atomic_ref from Two Concurrent Threads
-
Lesson 18: C++20 Coroutines
- Lesson 18 Overview—C++20 Coroutines
- Introduction to Coroutines
- Coroutine Support Libraries
- Installing the concurrencpp and generator Libraries—concurrencpp Library
- Installing the concurrencpp Library Using Visual Studio and vcpkg
- Installing the concurrencpp Library Using Docker or Linux and vcpkg
- Installing the concurrencpp and generator Libraries—generator Library
- Creating a Generator Coroutine with co_yield and the generator Library
- Creating a Generator Coroutine with co_yield and the generator Library—Diagram Showing the Flow of Control for a Generator Coroutine
- Launching Tasks with concurrencpp
- Launching Tasks with concurrencpp – concurrencpp::runtime
- Launching Tasks with concurrencpp – concurrencpp::thread_pool_executor
- Launching Tasks with concurrencpp – concurrencpp::task and concurrencpp::result
- Launching Tasks with concurrencpp – Example
- Launching Tasks with concurrencpp – Summary of concurrencpp Executors
- Creating a Coroutine with co_await and co_return—Overview of This Example
- Creating a Coroutine with co_await and co_return—Discussing the Code
- Creating a Coroutine with co_await and co_return—Flow of Control for the Sorting Coroutine Example
- Low-Level Coroutines Concepts—Resources
- Low-Level Coroutines Concepts—Coroutine Restrictions
- Low-Level Coroutines Concepts—Promise Object
- Low-Level Coroutines Concepts—Coroutine State
- Low-Level Coroutines Concepts—Coroutine Handle
- Low-Level Coroutines Concepts—Awaitable Objects
-
Lesson 19: Stream I/O C++20 Text formatting
- Lesson 19 Overview: Stream I/O C++20 Text formatting
- Streams
- Stream Output—Output of char* Variables
- Using Member Functions eof, get and put
- Comparing cin and cin.get
- Using Member Function getline
- istream Member Functions peek, putback and ignore
- Unformatted I/O Using read, write and gcount
- Integral Stream Base (dec, oct, hex and setbase)
- Floating-Point Precision (setprecision, precision)
- width Member Funsion of Classes istream and ostream
- User-Defined Output Stream Manipulators
- Trailing Zeros and Decimal Points (showpoint)
- Left and Right Alignment with Stream Manipulators left and right
- Printing an Integer with Internal Spacing and Plus Sign
- Padding (fill, setfill)
- Integral Stream Base (dec, oct, hex, showbase)
- Floating-Point Numbers; Scientific and Fixed Notation (scientific, fixed)
- Uppercase/Lowercase Control (uppercase)
- Specifying Boolean Format (boolalpha)
- Setting and Resetting the Format State via Member Function flags
- Stream Error States
- Tying an Output Stream to an Input Stream
- C++20 std::format Presentation Types
- C++20 std::format Field Widths and Alignment
- C++20 std::format Numeric Formatting
- C++20 std::format Field Width and Precision Placeholders
-
Lesson 20: Other Topics
- Lesson 20 Overview: Other Topics
- shared_ptr and weak_ptr Smart Pointers
- Reference Counted shared_ptr
- weak_ptr: shared_ptr Observer
- weak_ptr: shared_ptr Observer—Class Definitions for Classes Author and Book
- weak_ptr: shared_ptr Observer—main Function
- 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
- protected Class Members: A Deeper Look
- Non-Virtual Interface (NVI) Idiom
- Non-Virtual Interface (NVI) Idiom—Refactoring Class Employee for the NVI Idiom
- Non-Virtual Interface (NVI) Idiom—Updated Class SalariedEmployee
- Non-Virtual Interface (NVI) Idiom—Updated Class CommissionEmployee
- Non-Virtual Interface (NVI) Idiom—Runtime Polymorphism with the Employee Hierarchy Using NVI
- Inheriting Base-Class Constructors
- Multiple Inheritance
- Multiple Inheritance Example
- Diamond Inheritance
- Eliminating Duplicate Subobjects with virtual Base-Class Inheritance
- public, protected and private Inheritance
- namespaces: A Deeper Look
- Storage Classes and Storage Duration
- Operator Keywords
- decltype operator
- Trailing Return Types
- [[nodiscard]] Attribute
- Some Key C++23 Features
-
Lesson 18: C++20 Coroutines
-
Custom Class Templates and Compile-Time Polymorphism—Testing Class Template Stack
Product information
- Title: C++20 Fundamentals
- Author(s):
- Release date: January 2024
- Publisher(s): Pearson
- ISBN: 0136875181
You might also like
video
Python Fundamentals with Paul Deitel
Expanded in 2024 with 22 New Features through Python 3.12 50 hours of video instruction—Includes Paul’s …
video
Kubernetes for the Absolute Beginners - Hands-On
Starting from the fundamental concept of containers, the course gradually unfolds into a comprehensive guide on …
book
Python Crash Course, 3rd Edition
Python Crash Course is the world's best-selling guide to the Python guide programming language, with over …
video
Clean Code Fundamentals
Expanded Edition (Updated February 2022) Updated with episodes from SOLID Principles and Advanced TDD in the …