Log In
Join
 for free
Back To Course Home
C++17 in Detail: A Deep Dive
0% completed
Introduction
Language Features
Working With Maps
Debug Printing
Let's Start!
Removed or Fixed Language Features
Introduction
Removed Elements
Removing the 'register' Keyword
Removing Deprecated Operator ++ (bool)
Removing Deprecated Exception Specifications
Removing Trigraphs
Fixes
static_assert With No Message
Compiler Support
Removed And Deprecated Library Features
Introduction
Removing auto_ptr
Removed std::random_shuffle
Removing Old functional Stuff
`std::iterator` Is Deprecated
Other Smaller Removed or Deprecated Items
Compiler Support
Language Clarification
Introduction
Expression Evaluation Order
Evaluation Order in C++17
Guaranteed Copy Elision
Named Return Value Optimization
Non-movable/Non-copyable type
Updated Value Categories
Simplification of gl/prvalue
Dynamic Memory Allocation for Over-Aligned Data
Exception Specifications in the Type System
Quiz
Compiler Support
Templates
Introduction
Template Argument Deduction for Class Templates
Deduction Guides
Fold Expressions
Examples - Fold Expression
if constexpr
Template Code Simplification
Examples - Template Code Simplifications
Declaring Non-Type Template Parameters With auto
Other Modifications in C++ 17
Quiz
Compiler Support
General Language Features
Introduction
Structured Binding Declarations
The Syntax
Modifiers & Limitations
Binding
Providing Structured Binding Interface for Custom Class
Init Statement for if and switch
Using if In A Search Statement
Inline Variables
How Can It Simplify The Code
constexpr Lambda Functions
Capturing [*this] in Lambda Expressions
Nested Namespaces
__has_include Preprocessor Expression
Quiz
Compiler Support
Standard Attributes
Introduction
Why do we need attributes?
Before C++11
Attributes in C++11/C++14
C++17 additions
Third standard attribute
Namespaces/enumerators attributes
More on attributes
Summary
Quiz
Compiler Support
std::optional
Introduction
The Standard Library Changes
A Basic Example Of std::optional
std::optional Creation
in_place Construction
Default Construction
Constructors With Many Arguments
Returning std::optional
Be Careful With Braces When Returning
Accessing The Stored Value
Operations on std::optional
Examples Of std::optional
Performance & Memory Consideration
Special case: optional<bool> and optional<T*>
Summary
Quiz
Compiler Support
std::variant
Introduction
The basics
std::variant demo
When to Use std::variant
std::variant Creation
In Place Construction
Ambiguity and Complex Types
Changing the values
Object lifetime
Accessing Stored Value
Visitors for std::variant
Overload
Visiting Multiple Variants
Exception safety guarantees
Performance & Memory Considerations
Examples of std::variant
Parsing command line
Parsing and State Machines
Polymorphism
Wrap up
Quiz
Compiler Support
std::any
Introduction
The Basics
Object Creation
Accessing The Stored Value
Performance & Memory Considerations
Migration from boost::any
Summary
Compiler Support
std::string_view
Introduction
The Basics
When to Use
The std::basic_string_view Type
std::string_view Creation
Other Operations
Risks Using string_view
Problem With The Initial Example
Reference Lifetime Extension
Choosing between string & string_view
Initializing string Members from string_view
Handling Non-Null Terminated Strings
Printing With printf()
Conversion Functions Like atoi()/atof()
General Solution
Performance & Memory Considerations
Strings in Constant Expressions
Migration from boost::string_ref and boost::string_view
Example: Working with Different String APIs
Example: String Split
Wrap Up
Quiz
Compiler Support
Searchers and String Matching
Introduction
Overview of String Matching Algorithms
New Algorithms Available in C++ 17
Using Searchers
Examples - Using Searchers
DNA Matching
Summary
Compiler Support
String Conversions
Introduction
Elementary string conversions
from_chars
Examples
to_chars
The benchmark
Summary
Quiz
Compiler Support
Filesystem
Introduction
Overview
Demo Example for Path Object
The Path Object
Path Composition
The Directory Entry & Directory Iteration
Supporting Functions
File Permissions
Error Handling & File Races
Examples of using std:filesystem
Summary
Compiler Support
Parallel STL Algorithms
Introduction
C++17's Parallelism
Execution Policies
Par/Seq Policy Usage
Exceptions
Algorithm Update
For_Each and Reduce Algorithms
More Algorithms
Performance of Parallel Algorithms
Benchmark I
Benchmark II
Processing Containers
Erroneous Techniques in Parallel Algorithms
Counting Elements
Summary
Quiz
Compiler Support
Other Changes in the Library
Introduction
std::byte
Improvements for Maps and Sets
Emplace Enhancements for Maps and Unordered Maps
Return Type of Emplace Methods
Sampling Algorithms
New Mathematical Functions
Shared Pointers and Arrays
Non-member size(), data() and empty()
constexpr Additions to the Standard Library
std::scoped_lock
Polymorphic Allocator
Compiler Support
Refactoring with std::optional and std::variant
Introduction
The Use Case
The Tuple Version
A Separate Structure
With std::optional
With std::variant
Wrap Up
Enforcing Code Contracts With [[nodiscard]]
Introduction
Where Can It Be Used?
Everywhere?!
How to Ignore [[nodiscard]]
Summary
Replacing enable_if with if constexpr - Factory with Variable Arguments
Introduction
With if constexpr
Summary
How to Parallelise CSV Reader
Introduction
Application Requirements
The Serial Version
The Core Parts
Converting Lines into Records
The OrderRecord Class
Calculations
Using Parallel Algorithms
Data Size and Instruction Count Matters
Parallel Data Conversion
Parallel Calculations
Tests
Wrap Up & Discussion
Quiz
Get hands-on with 1400+ tech skills courses.
Start Free Trial