Log In
0% completed
All Lessons
Free Lessons (13)
Introduction
About This Course
New C++20 Features
Chapter Overview
Format Text with the New Format Library
Use Compile-Time Vectors and Strings with Constexpr
Safely Compare Integers of Different Types
Use the Spaceship Operator <=> for Three-Way Comparisons
Easily Find Feature Test Macros with the <version> Header
Create Safer Templates with Concepts and Constraints
Avoid Re-Compiling Template Libraries with Modules
Create Views into Containers with Ranges
Quiz: C++20 Features
General STL Features
Chapter Overview
Use the New Span Class to Make Our C-Arrays Safer
Use Structured Binding to Return Multiple Values
Initialize Variables within if and switch Statements
Use Template Argument Deduction for Simplicity and Clarity
Use If constexpr to Simplify Compile-Time Decisions
Quiz: General STL Features
Challenge: Make Our Code Safer and Easier to Read
STL Containers
Chapter Overview
Use Uniform Erasure Functions to Delete Items from a Container
Delete Items from an Unsorted Vector in Constant Time
Access Vector Elements Directly and Safely
Keep Vector Elements Sorted
Efficiently Insert Elements into a Map
Efficiently Modify the Keys of Map Items
Use unordered_map with Custom Keys
Use Set to Sort and Filter User Input
A Simple RPN Calculator with Deque
A Word Frequency Counter with Map
Find Long Sentences with a Vector of Vectors
A ToDo List Using Multimap
Quiz: STL Containers
Challenge: Let's Play with Containers
Compatible Iterators
Chapter Overview
Iterators Are Fundamental
Create an Iterable Range
Make Our Iterators Compatible with STL Iterator Traits
Use Iterator Adapters to Fill STL Containers
Create a Generator as Iterators
Use Reverse Iterator Adapters to Iterate Backward
Iterate Objects of Unknown Length with a Sentinel
Build a Zip Iterator Adapter
Create a Random-Access Iterator
Quiz: Compatible Iterators
Challenge: Reverse Everything in a String
Lambda Expressions
Chapter Overview
Lambda Expressions
Use Lambdas for Scoped Reusable Code
Use Lambdas as Predicates with the Algorithm Library
Use std::function as a Polymorphic Wrapper
Concatenate Lambdas with Recursion
Combine Predicates with Logical Conjunction
Call Multiple Lambdas with the Same Input
Use Mapped Lambdas for a Jump Table
Quiz: Lambda Expressions
Challenge: Output with Lambda Expressions
STL Algorithms
Chapter Overview
Copy from One Iterator to Another
Join Container Elements into a String
Sort Containers with std::sort()
Modify Containers with std::transform
Find Items in a Container
Limit the Values of a Container to a Range with std::clamp
Sample Data Sets with std::sample
Generate Permutations of Data Sequences
Merge Sorted Containers
Quiz: STL Algorithms
Challenge: Let's Dive into Algorithms
Strings, Streams, and Formatting
Chapter Overview
Use string_view as a Lightweight String Object
Concatenate Strings
Transform Strings
Format Text with C++20’s Format Library
Trim Whitespace from Strings
Read Strings from User Input
Count Words in a File
Initialize Complex Structures From File Input
Customize a String Class With char_traits
Parse Strings with Regular Expressions
Quiz: Strings, Streams and Formatting
Challenge: String With a Zero Space
Utility Classes
Chapter Overview
Manage Optional Values with std::optional
Use std::any for Type Safety
Store Different Types with std::variant
Time Events with std::chrono
Use Fold Expressions for Variadic Tuples
Manage Allocated Memory with std::unique_ptr
Share Objects with std::shared_ptr
Use Weak Pointers with Shared Objects
Share Members of a Managed Object
Compare Random Number Engines
Compare Random Number Distribution Generators
Quiz: Utility Classes
Challenge: Let's Check Out the Type of Data
Concurrency and Parallelism
Chapter Overview
Sleep for a Specific Amount of Time
Use std::thread for Concurrency
Use std::async for Concurrency
Run STL Algorithms in Parallel with Execution Policies
Share Data Safely with Mutex and Locks
Share Flags and Values with std::atomic
Initialize Threads with std::call_once
Use std::condition_variable to Resolve the Producer-Consumer
Quiz: Concurrency and Parallelism
Challenge: Sleep in a Multithread Function Call
Using the File System
Chapter Overview
Specialize std::formatter for the Path Class
Use Manipulation Functions with Path
List Files in a Directory
Search Directories and Files With a Grep Utility
Rename Files with Regex and directory_iterator
Create a Disk Usage Counter
Quiz: Usage of the File System
Challenge: What's Inside a Path?
A Few More Ideas
Chapter Overview
Create a Trie Class for Search Suggestions
Implement Multiple Producers and Consumers
Calculate the Error Sum of Two Vectors
Build Our Own Algorithm: Split
Leverage Existing Algorithms: Gather
Remove Consecutive Whitespace
Convert Numbers to Words
Quiz: Trie, Gather Function, and White Space Removal
Challenge: Remove Whatever is White!
Conclusion
Final Thoughts
C++20 STL Cookbook
/
...
/
Challenge: String With a Zero Space
Challenge: String With a Zero Space
Complete this hands-on exercise to test your knowledge.
We'll cover the following...
Problem statement
Input
Output
Exercise
Solution
Problem statement
...