C++17 in Detail
$129.00
Minimum price
$179.00
Suggested price

Course Info

This course includes 1 attempt.

If you’ve ever asked “what’s in C++17 and what does it mean for me and my code?” — and I hope you have — then this book is for you.

Herb Sutter, herbsutter.com

C++11 was a major update for the language. With all the modern features like lambdas, constexpr, variadic templates, threading, range-based for loops, smart pointers and many more powerful elements, it was enormous progress for the language. Even now, in 2018, lots of teams struggle to modernise their projects to leverage all the modern features. Later there was a minor update - C++14, which improved some things from the previous standard and added a few smaller elements. With C++17 we got a lot of mixed emotions.

Although C++17 is not as big as C++11, it's larger than C++14. Everyone expected modules, co-routines, concepts and other powerful features, but it wasn't possible to prepare everything on time.

Is C++17 weak?

Far from it! And this course will show you why!

I spent hundreds of hours investigating how the new things work in order to make a nice and practical course for you. The course will not only save your time but also will guide you through all the nuances of the language.

The course brings you exclusive content about C++17 and draws from the experience of many articles that have appeared on bfilipek.com (and cppstories.com). It is based on the book C++17 in Detail: Learn the Exciting Features of The New C++ Standard!

The chapters were rewritten from the ground-up and updated with the latest information. All of that equipped with lots of new examples and practical tips. Additionally, the course provides insight into the current implementation status, compiler support, performance issues and other relevant knowledge to boost your current projects.

If you have experience with C++11/14 and you want to move forward into the latest C++ standard, then this course is for you.

Here are the features you'll learn:

Part One: C++17 Language features

  • Fixes and deprecation
  • Language clarification
  • General language features
  • Templates
  • Attributes

Part Two: C++17 The Standard Library

  • std::optional
  • std::variant
  • std::any
  • std::string_view
  • String Conversions
  • String Matching & Searchers
  • Filesystem
  • Parallel STL
  • Other Changes

Part Three: More Examples and Use Cases

  • Refactoring with std::optional
  • Using if constexpr
  • Using [[nodiscard]] attribute
  • How to parallelise applications

Share

Course Material

  • Part 1 - Language Features
  • 1. Quick Start
  • Working With Maps
  • Debug Printing
  • Let’s Start!
  • 2. Removed or Fixed Language Features
  • Removed Elements
  • Removing the register Keyword
  • Removing Deprecated operator++(bool)
  • Removing Deprecated Exception Specifications
  • Removing Trigraphs
  • Artboard 3 Created with Sketch.
    Exercise 1
  • Fixes
  • New auto rules for direct-list-initialisation
  • static_assert With no Message
  • Different begin and end Types in Range-Based For Loop
  • Artboard 3 Created with Sketch.
    Exercise 2
  • Compiler Support
  • Artboard 3 Created with Sketch.
    Exercise 3
  • icon/quiz Created with Sketch.
    Quiz 11 attempt allowed
  • 3. Language Clarification
  • Stricter Expression Evaluation Order
  • The Changes
  • Artboard 3 Created with Sketch.
    Exercise 4
  • Guaranteed Copy Elision
  • Updated Value Categories
  • Artboard 3 Created with Sketch.
    Exercise 5
  • Dynamic Memory Allocation for Over-Aligned Data
  • Artboard 3 Created with Sketch.
    Exercise 6
  • Exception Specifications in the Type System
  • Artboard 3 Created with Sketch.
    Exercise 7
  • Compiler Support
  • Artboard 3 Created with Sketch.
    Exercise 8
  • icon/quiz Created with Sketch.
    Quiz 21 attempt allowed
  • 4. General Language Features
  • Structured Binding Declarations
  • The Syntax
  • Modifiers
  • Structured Binding Limitations
  • Binding
  • Examples
  • Expressive Code With Structured Bindings
  • Providing Structured Binding Interface for Custom Class
  • Artboard 3 Created with Sketch.
    Exercise 9
  • Init Statement for if and switch
  • Artboard 3 Created with Sketch.
    Exercise 10
  • Inline Variables
  • How Can it Simplify the Code?
  • Artboard 3 Created with Sketch.
    Exercise 11
  • constexpr Lambda Expressions
  • Artboard 3 Created with Sketch.
    Exercise 12
  • Capturing [*this] in Lambda Expressions
  • Artboard 3 Created with Sketch.
    Exercise 13
  • Nested Namespaces
  • Artboard 3 Created with Sketch.
    Exercise 14
  • __has_include Preprocessor Expression
  • Artboard 3 Created with Sketch.
    Exercise 15
  • Compiler support
  • Artboard 3 Created with Sketch.
    Exercise 16
  • icon/quiz Created with Sketch.
    Quiz 31 attempt allowed
  • 5. Templates
  • Template Argument Deduction for Class Templates
  • Deduction Guides
  • CTAD Limitations
  • Artboard 3 Created with Sketch.
    Exercise 17
  • Fold Expressions
  • More Examples
  • Artboard 3 Created with Sketch.
    Exercise 18
  • if constexpr
  • Why Compile Time If?
  • Template Code Simplification
  • Examples
  • Line Printer
  • Declaring Custom get Functions
  • Artboard 3 Created with Sketch.
    Exercise 19
  • Declaring Non-Type Template Parameters With auto
  • Artboard 3 Created with Sketch.
    Exercise 20
  • Other Changes
  • Allow typename in a Template Template Parameters.
  • Allow Constant Evaluation for all Non-Type Template Arguments
  • Variable Templates for Traits
  • Pack Expansions in Using Declarations
  • Logical Operation Metafunctions
  • std::void_t Transformation Trait
  • Compiler Support
  • Artboard 3 Created with Sketch.
    Exercise 21
  • icon/quiz Created with Sketch.
    Quiz 41 attempt allowed
  • 6. Standard Attributes
  • Why Do We Need Attributes?
  • Artboard 3 Created with Sketch.
    Exercise 22
  • Before C++11
  • GCC Specific Attributes
  • MSVC Specific Attributes
  • Clang Specific Attributes
  • Artboard 3 Created with Sketch.
    Exercise 23
  • Attributes in C++11 and C++14
  • In C++11 we have the following attributes:
  • [[noreturn]] :
  • [[carries_dependency]] :
  • C++14 added:
  • [[deprecated]] and [[deprecated("reason")]] :
  • Artboard 3 Created with Sketch.
    Exercise 24
  • C++17 Additions
  • [[fallthrough]] Attribute
  • [[maybe_unused]] Attribute
  • [[nodiscard]] Attribute
  • Attributes for Namespaces and Enumerators
  • Ignore Unknown Attributes
  • Using Attribute Namespaces Without Repetition
  • Artboard 3 Created with Sketch.
    Exercise 25
  • Section Summary
  • Compiler support
  • Artboard 3 Created with Sketch.
    Exercise 26
  • icon/quiz Created with Sketch.
    Quiz 51 attempt allowed
  • Part 2 - The Standard Library Changes
  • 7. std::optional
  • Introduction
  • When to Use
  • 1) If you want to represent a nullable type.
  • 2) Return a result of some computation (processing) that fails to produce a value and is not an error.
  • 3) To perform lazy-loading of resources.
  • 4) To pass optional parameters into functions.
  • A Basic Example
  • Artboard 3 Created with Sketch.
    Exercise 27
  • std::optional Creation
  • in_place Construction
  • Default Construction
  • Non Copyable/Movable Types
  • Constructors With Many Arguments
  • std::make_optional()
  • Artboard 3 Created with Sketch.
    Exercise 28
  • Returning std::optional
  • Be Careful With Braces when Returning
  • Artboard 3 Created with Sketch.
    Exercise 29
  • Accessing The Stored Value
  • Artboard 3 Created with Sketch.
    Exercise 30
  • std::optional Operations
  • Changing the Value & Object Lifetime
  • Comparisons
  • Artboard 3 Created with Sketch.
    Exercise 31
  • Performance & Memory Consideration
  • Artboard 3 Created with Sketch.
    Exercise 32
  • Migration from boost::optional
  • Special case: optional and optional
  • Artboard 3 Created with Sketch.
    Exercise 33
  • Examples of std::optional
  • User Name with an Optional Nickname and Age
  • Parsing ints From the Command Line
  • Other Examples
  • Artboard 3 Created with Sketch.
    Exercise 34
  • Summary
  • Artboard 3 Created with Sketch.
    Exercise 35
  • Compiler Support
  • icon/quiz Created with Sketch.
    Quiz 61 attempt allowed
  • 8. std::variant
  • The Basics
  • When to Use
  • A Functional Background
  • Artboard 3 Created with Sketch.
    Exercise 36
  • std::variant Creation
  • About std::monostate
  • In Place Construction
  • Ambiguity
  • Complex Types
  • Unwanted Type Conversions And Narrowing
  • Artboard 3 Created with Sketch.
    Exercise 37
  • Changing the Values
  • Object Lifetime
  • Artboard 3 Created with Sketch.
    Exercise 38
  • Accessing the Stored Value
  • Artboard 3 Created with Sketch.
    Exercise 39
  • Visitors for std::variant
  • Overload
  • Visiting Multiple Variants
  • Artboard 3 Created with Sketch.
    Exercise 40
  • Other std::variant Operations
  • Artboard 3 Created with Sketch.
    Exercise 41
  • Exception Safety Guarantees
  • Performance & Memory Considerations
  • Artboard 3 Created with Sketch.
    Exercise 42
  • Migration From boost::variant
  • Artboard 3 Created with Sketch.
    Exercise 43
  • Examples of std::variant
  • Error Handling
  • Parsing a Command Line
  • Parsing a Config File
  • State Machines
  • Polymorphism
  • Artboard 3 Created with Sketch.
    Exercise 44
  • Wrap Up
  • Artboard 3 Created with Sketch.
    Exercise 45
  • Compiler Support
  • icon/quiz Created with Sketch.
    Quiz 71 attempt allowed
  • 9. std::any
  • The Basics
  • When to Use
  • Artboard 3 Created with Sketch.
    Exercise 46
  • std::any Creation
  • In Place Construction
  • Complex Types
  • Artboard 3 Created with Sketch.
    Exercise 47
  • Changing the Value
  • Object Lifetime
  • Artboard 3 Created with Sketch.
    Exercise 48
  • Accessing The Stored Value
  • Artboard 3 Created with Sketch.
    Exercise 49
  • Performance & Memory Considerations
  • Artboard 3 Created with Sketch.
    Exercise 50
  • Migration from boost::any
  • Artboard 3 Created with Sketch.
    Exercise 51
  • Examples of std::any
  • Parsing files
  • Message Passing
  • Properties
  • Artboard 3 Created with Sketch.
    Exercise 52
  • Wrap Up
  • Artboard 3 Created with Sketch.
    Exercise 53
  • Compiler Support
  • icon/quiz Created with Sketch.
    Quiz 81 attempt allowed
  • 10. std::string_view
  • Artboard 3 Created with Sketch.
    Exercise 54
  • The Basics
  • When to Use
  • Artboard 3 Created with Sketch.
    Exercise 55
  • The std::basic_string_view Type
  • Artboard 3 Created with Sketch.
    Exercise 56
  • std::string_view Creation
  • Artboard 3 Created with Sketch.
    Exercise 57
  • Other Operations
  • Artboard 3 Created with Sketch.
    Exercise 58
  • Risks Using string_view
  • Taking Care of Not Null-Terminated Strings
  • References and Temporary Objects
  • Problems with the Initial Example
  • Reference Lifetime Extension
  • Artboard 3 Created with Sketch.
    Exercise 59
  • Initializing string Members from string_view
  • Artboard 3 Created with Sketch.
    Exercise 60
  • Handling Non-Null Terminated Strings
  • Printing with printf()
  • Conversion Functions Like atoi()/atof():
  • A General Solution
  • Artboard 3 Created with Sketch.
    Exercise 61
  • Performance & Memory Considerations
  • Strings in Constant Expressions
  • Artboard 3 Created with Sketch.
    Exercise 62
  • Migration from boost::string_ref and boost::string_view
  • Examples
  • Working with Different String APIs
  • String Split
  • Artboard 3 Created with Sketch.
    Exercise 63
  • Wrap Up
  • Compiler support:
  • Artboard 3 Created with Sketch.
    Exercise 64
  • icon/quiz Created with Sketch.
    Quiz 91 attempt allowed
  • 11. String Conversions
  • Elementary String Conversions
  • Artboard 3 Created with Sketch.
    Exercise 65
  • Converting From Characters to Numbers: from_chars
  • Examples
  • 1) Integral types
  • 2) Floating Point
  • Parsing a Command Line
  • Artboard 3 Created with Sketch.
    Exercise 66
  • Converting Numbers into Characters: to_chars
  • An Example
  • Artboard 3 Created with Sketch.
    Exercise 67
  • The Benchmark
  • Artboard 3 Created with Sketch.
    Exercise 68
  • Summary
  • Compiler support
  • Artboard 3 Created with Sketch.
    Exercise 69
  • icon/quiz Created with Sketch.
    Quiz 101 attempt allowed
  • 12. Searchers & String Matching
  • Overview of String Matching Algorithms
  • Artboard 3 Created with Sketch.
    Exercise 70
  • New Algorithms Available in C++17
  • Using Searchers
  • Artboard 3 Created with Sketch.
    Exercise 71
  • Examples
  • Performance Experiments
  • DNA Matching
  • Artboard 3 Created with Sketch.
    Exercise 72
  • Summary
  • Artboard 3 Created with Sketch.
    Exercise 73
  • Compiler support
  • icon/quiz Created with Sketch.
    Quiz 111 attempt allowed
  • 13. Filesystem
  • Filesystem Overview
  • Core Parts of The Library
  • Demo
  • Artboard 3 Created with Sketch.
    Exercise 74
  • The Path Object
  • Path Operations
  • Comparison
  • Path Composition
  • Stream Operators
  • Path Formats and Conversion
  • Artboard 3 Created with Sketch.
    Exercise 75
  • The Directory Entry & Directory Iteration
  • Traversing a Path with Directory Iterators
  • directory_entry Methods
  • Artboard 3 Created with Sketch.
    Exercise 76
  • Supporting Functions
  • Getting & Displaying the File Time
  • File Permissions
  • Setting Permissions
  • Note for Windows
  • Artboard 3 Created with Sketch.
    Exercise 77
  • Error Handling & File Races
  • File Races
  • Examples
  • Loading a File into a String
  • Creating Directories
  • Filtering Files Using Regex
  • Optimisation & Code Cleanup
  • Artboard 3 Created with Sketch.
    Exercise 78
  • Lesson Summary
  • Compiler Support
  • GCC/libstdc++
  • Clang/libc++
  • Visual Studio
  • Compiler Support Summary
  • Artboard 3 Created with Sketch.
    Exercise 79
  • icon/quiz Created with Sketch.
    Quiz 121 attempt allowed
  • 14. Parallel STL Algorithms
  • Introduction
  • Not Only Threads
  • Overview
  • Artboard 3 Created with Sketch.
    Exercise 80
  • Execution Policies
  • Understanding Execution Policies
  • Limitations and Unsafe Instructions
  • Exceptions
  • Artboard 3 Created with Sketch.
    Exercise 81
  • Algorithm Update
  • New Algorithms
  • For Each Algorithm
  • Understanding Reduce Algorithms
  • transform_reduce - Fused Algorithm
  • Scan Algorithms
  • Artboard 3 Created with Sketch.
    Exercise 82
  • Performance of Parallel Algorithms
  • Artboard 3 Created with Sketch.
    Exercise 83
  • Examples
  • Benchmark
  • Processing Several Containers At the Same Time
  • Separate Container of Indices
  • Zip Iterators
  • Erroneous Technique
  • Counting Elements
  • More Examples
  • Artboard 3 Created with Sketch.
    Exercise 84
  • Lesson Summary
  • Artboard 3 Created with Sketch.
    Exercise 85
  • Compiler Support
  • Artboard 3 Created with Sketch.
    Exercise 86
  • icon/quiz Created with Sketch.
    Quiz 131 attempt allowed
  • 15. Other Changes In The Library
  • std::byte
  • Artboard 3 Created with Sketch.
    Exercise 87
  • Improvements for Maps and Sets
  • Splicing
  • Emplace Enhancements for Maps and Unordered Maps
  • try_emplace Method
  • insert_or_assign Method
  • Artboard 3 Created with Sketch.
    Exercise 88
  • Return Type of Emplace Methods
  • Artboard 3 Created with Sketch.
    Exercise 89
  • Sampling Algorithms
  • Artboard 3 Created with Sketch.
    Exercise 90
  • New Mathematical Functions
  • Artboard 3 Created with Sketch.
    Exercise 91
  • Shared Pointers and Arrays
  • Non-member size(), data() and empty()
  • Artboard 3 Created with Sketch.
    Exercise 92
  • constexpr Additions to the Standard Library
  • Artboard 3 Created with Sketch.
    Exercise 93
  • std::scoped_lock
  • Polymorphic Allocator, pmr
  • Core elements of pmr:
  • More Information
  • Artboard 3 Created with Sketch.
    Exercise 94
  • Compiler support
  • icon/quiz Created with Sketch.
    Quiz 141 attempt allowed
  • 16. Removed And Deprecated Library Features
  • Removing auto_ptr
  • Artboard 3 Created with Sketch.
    Exercise 95
  • Removed std::random_shuffle
  • Artboard 3 Created with Sketch.
    Exercise 96
  • “Removing Old functional Stuff”
  • Artboard 3 Created with Sketch.
    Exercise 97
  • std::iterator Is Deprecated
  • Artboard 3 Created with Sketch.
    Exercise 98
  • Other Smaller Removed or Deprecated Items
  • Deprecating shared_ptr::unique()
  • Deprecating
  • Removing Deprecated Iostreams Aliases
  • Deprecate C library headers
  • Deprecate std::result_of
  • Deprecate std::memory_order_consume Temporarily
  • Remove allocator support from std::function
  • Artboard 3 Created with Sketch.
    Exercise 99
  • Compiler support
  • Artboard 3 Created with Sketch.
    Exercise 100
  • icon/quiz Created with Sketch.
    Quiz 151 attempt allowed
  • Part 3 - More Examples and Use Cases
  • 17. Refactoring with std::optional and std::variant
  • The Use Case
  • Artboard 3 Created with Sketch.
    Exercise 101
  • The Tuple Version
  • Artboard 3 Created with Sketch.
    Exercise 102
  • A Separate Structure
  • Artboard 3 Created with Sketch.
    Exercise 103
  • With std::optional
  • With std::variant
  • Artboard 3 Created with Sketch.
    Exercise 104
  • Wrap up
  • Artboard 3 Created with Sketch.
    Exercise 105
  • icon/quiz Created with Sketch.
    Quiz 161 attempt allowed
  • 18. Enforcing Code Contracts With [[nodiscard]]
  • Introduction
  • Artboard 3 Created with Sketch.
    Exercise 106
  • Where Can It Be Used?
  • Errors
  • Factories / Handles
  • When Returning Non-Trivial Types?
  • Code With No Side Effects?
  • Everywhere?!
  • Artboard 3 Created with Sketch.
    Exercise 107
  • How to Ignore [[nodiscard]]
  • Artboard 3 Created with Sketch.
    Exercise 108
  • Before C++17
  • Artboard 3 Created with Sketch.
    Exercise 109
  • Summary
  • icon/quiz Created with Sketch.
    Quiz 171 attempt allowed
  • 19. Replacing enable_if with if constexpr - Factory with Variable Arguments
  • The Problem
  • Artboard 3 Created with Sketch.
    Exercise 110
  • Before C++17
  • Artboard 3 Created with Sketch.
    Exercise 111
  • With if constexpr
  • Artboard 3 Created with Sketch.
    Exercise 112
  • Summary
  • icon/quiz Created with Sketch.
    Quiz 181 attempt allowed
  • 20. How to Parallelise CSV Reader
  • Introduction and Requirements
  • Artboard 3 Created with Sketch.
    Exercise 113
  • The Serial Version
  • The Main
  • Converting Lines into Records
  • The OrderRecord Class
  • The conversion
  • Calculations
  • Design Enhancements
  • Running the Code
  • Artboard 3 Created with Sketch.
    Exercise 114
  • Using Parallel Algorithms
  • Data Size & Instruction Count Matters
  • Parallel Data Conversion
  • Parallel Calculations
  • Artboard 3 Created with Sketch.
    Exercise 115
  • Tests
  • Mid Size Files 1k Lines 10 Files
  • Large Set 10k Lines in 10 Files
  • Largest Set 100k Lines in 10 Files
  • Artboard 3 Created with Sketch.
    Exercise 116
  • Wrap up & Discussion
  • Additional Modifications and Options
  • Artboard 3 Created with Sketch.
    Exercise 117
  • icon/quiz Created with Sketch.
    Quiz 191 attempt allowed

Instructors

    • Bartłomiej (Bartek) Filipek is a C++ software developer from the beautiful city of Cracow in Poland He started his professional coding career in 2007. In 2010 he graduated from Jagiellonian University in Cracow, Poland, with a Master's Degree in Computer Science.

      Bartek currently works at Xara, where he develops features for advanced document editors. He also has experience with desktop graphics applications, game development, large-scale systems for aviation, writing graphics drivers and even biofeedback. In the past, Bartek has also taught programming (mostly game and graphics programming courses) at local universities in Cracow.

      Since 2011 Bartek has been regularly blogging at bfilipek.com and cppstories.com. Initially, the topics revolved around graphics programming, but now the blog focuses on core C++. He's also a co-organiser of the C++ User Group in Cracow. You can hear Bartek in one @CppCast episode where he talks about C++17, blogging and text processing.

      Since October 2018, Bartek has been a C++ Expert for the Polish National Body, which works directly with ISO/IEC JTC 1/SC 22 (C++ Standardisation Committee).

      In the same month, Bartek was awarded his first MVP title for the years 2019/2020 by Microsoft.

      In his spare time, he loves assembling Lego models with his little son.

      See his blog at cppstories.com.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub