
Awareness of C++ versions and which ones this course focuses on.
Review how local variables are implemented and the different ways to pass arguments to functions, understand C++'s use of value semantics
Revise constructor, copy constructor, assignment operator and destructor.
Review of the traditional array, plus std::string and std::vector
Review of iterators.
Review of STL algorithms.
Revision of std::deque and std::list.
Revision of std::set, std::map, std::multiset and std::multiset.
Examples of use for std::set, std::map, std::multiset and std::multiset.
Revision of queue, priority queue and stack.
Revision of operator overloading. Awareness of function call operator and functor.
How to use predicate functions to modify the behaviour of STL algorithms.
Revise inheritance, derived classes, member function inheritance, protected access.
Revise virtual functions, polymorphism, pure virtual functions and abstract base class, virtual destructors.
Revise the friend keyword.
Revise exceptions, try and catch blocks.
throw() with a list of exceptions. Is it really useful?
Revision of function templates and class templates.
Revision of namespaces.
Revise compiler-generated special member functions: default constructor, copy constructor, assignment operator, destructor and the "Rule of Three".
C++ does not have a garbage collector. How does it manage resources?
Revise C-style cast and the four types of C++ cast.
When is a copy not a copy?
Some other, very useful, features which were added in C++98.
New integer types and literals, raw strings, string literals.
How to create your own suffixes and literals. How to make scientific units type-safe and avoid the fate of the Mars Rover!
Modern C++ has a universal initialization syntax. Now you can initialize a container in a single statement!
The new, improved support for enumerated types in Modern C++.
Save typing (and mental energy) when creating variables with complex types.
Writing a typical loop is much simpler with Modern C++'s range for loop feature.
Safe initialization of members of built-in type. How to avoid writing constructors with default arguments.
Modern C++ has keywords which help us manage compiler-generated special member functions.
How to prevent unwanted type conversions.
Useful new features which make working with derived classes easier.
Modern C++'s replacement for throw()
Simplify working with nested namespaces.
Why are lambdas useful? Lambda expression syntax.
Comparison of algorithm call + lambda expression against hand-written loop.
How to make local variables available in a lambda expression.
How to modify data from a lambda. How to use lambdas in member functions.
Some functional programming techniques with lambdas.
Generic lambdas and lambda-local variables.
A simple way to pass and return a variable number of arguments of the same type.
Improvements to insert() operations in Modern C++.
Optimizes inserting temporary objects into containers - perhaps.
An easier way to return multiple values from a function.
Combines the efficiency of built-in fixed-length arrays with the type safety and versatile interface of STL containers.
New containers in Modern C++, including more efficient versions of associative containers.
An alternative way to perform partial evaluation.
Modern C++ has a generic function object
Modern C++ has much better facilities for working with random numbers.
Working with times is much easier with Modern C++'s chrono library.
Modern C++ has a standard complex number class.
A class which simplifies bit operations.
Some useful additions to the toolbox.
Algorithms which use random number engines.
Exercises to test your understanding of the material in this section.
Not actually a Modern C++ feature, but it illustrates some of the issues with extraneous copying.
Modern C++ reduces the overhead from copying temporary objects.
What exactly is an rvalue?
Overloads of the copy constructor and assignment operator which support move semantics.
Modern C++ has two new special member functions.
Move-only class and RAII idiom. How to make a lambda expression capture by move.
How to write a template function argument that can take either an lvalue or an rvalue. Also known as a "universal reference."
How to forward function arguments without losing their properties.
How to launch a thread.
Issues arising when threads share data, and the golden rule of C++ multithreading.
How to use a mutex to avoid a data race.
Waiting for you but you're waiting for me....
An alternative to mutexes that has less overhead but is more difficult to use correctly.
A low-level way for threads to communicate.
How to send a result from one thread to another.
Running tasks in the background.
How Modern C++ removes the need for explicit memory management.
Smart pointer class which owns a memory allocation.
Polymorphic containers and custom deleters.
Speed up compilation of large programs - at a price.
Use reference counting to share allocated memory between objects.
Smart pointer that shares memory weakly.
How to write a function with a variable number of arguments safely.
Compile-time version of assert() and a technique for avoiding "template bloat".
When const isn't enough, reach for constexpr...
Compile-time functions which return constant expressions. An alternative to template metaprogramming in some cases.
How the compiler deduces types for template functions. This video is mainly intended for reference purposes. Note that the attached source file requires a C++17 compiler.
How the compiler deduces types for auto and decltype declarations. This video is mainly intended for reference purposes.
Advice on how to use Modern C++ language features.
Advice on how to use Modern C++ library features, plus guidelines for passing function arguments.
This course is intended for C++ developers who wish to update and refresh their C++ skills, especially those who have been using other languages for several years. You will learn about the new language features, how they make programming in C++ less painful and more productive, and how to use them idiomatically,
If you're used to traditional C++, Modern C++ will feel like a different language. It is safer, more expressive and more efficient. With Modern C++, you no longer need to work with explicit pointers to memory, which you have to allocate and release yourself. Complex loops can be greatly simplified, or even avoided altogether. Better abstractions remove the amount of "boilerplate" code you have to type in, leaving you free to concentrate on the problem you are trying to solve.
Modern C++ will reduce your development time and make your code easier to maintain and more likely to be correct and efficient. It avoids many situations which cause undefined program behaviour, resulting in less time spent on debugging and fewer defect reports.
The course begins with a review of C++ as of the 1998/2003 standards, including exceptions, templates and the Standard Template Library. If you have not used C++ for some time, this will allow you to revise and refresh your existing knowledge.
We then cover the changes in 2011 and 2014, starting with the core language and the standard library. Important new features such as lambda expressions, move semantics and multithreading have their own sections. Another section covers the most important features in C++17, which is the most recent widely-used version in industry. Finally, there is some advice on how to use good practice when writing Modern C++ code.
Each lecture contains a demonstration of the features being covered and has downloadable resources: the source code used in the video, exercises and solutions for the exercises. These are fairly simple and test your understanding of the topic you have just learnt.
There are also occasional assignments. These are more challenging than the lecture exercises.
After successfully completing this course, you will have a good knowledge of the new features in Modern C++ and how to use them.