C++ is a powerful and complex language. This course covers advanced C++ language features and development techniques, to help you get the most out of the language. The course also provides thorough coverage of the C++ Standard Template Library (STL), and explains how to implement OO design patterns and C++ programming idioms to reinforce best practice in your code.
Templates have been an integral part of C++ for decades, but there are several techniques and idioms that remain clouded in mystery for many developers. This module lifts the lid on various advanced template techniques, including template specialization, partial specialization, and non-type parameters. We also show how to define template types within a template header, and how to use policies and traits to achieve metaprogramming using templates.
The C++ Standard Template Library makes extensive use of iterators and algorithms. This module explores both these topics in detail. We begin with a description of the different types of iterator available in C++, and follow this up with a close look at standard C++ algorithms for manipulating, searching, and sorting data collections.
Function objects, also known as functors, play an essential role in C++. A function object is an object that behaves like a function, in the sense that you can apply the () function-call operator on an object to tell it to perform its designated action. This module tells you everything you need to know about how to define and use function objects in C++.
This module describes how to use reference counting techniques to manage object allocation/deallocation in C++. During the module we implement a standardized reference counting solution that you can use in any of your own solutions.
RAII stands for "Resource Acquisition Is Initialization". RAII is an important pattern/idiom in C++, as it helps you ensure objects are released properly and consistently. This module explains the role of RAII in resource management, explores real-world scenarios where RAII is beneficial, and shows how to implement RAII-based solutions in C++.
Memory management lies at the heart of C++. It's vitally important to ensure memory is allocated and deallocated consistently and efficiently. This module shows how to take control of dynamic memory by overriding the new and delete operators. We also show how to implement smart pointers by overriding the * and -> operators.
This module takes a close look at exception syntax and techniques in C++. We address issues such as designing and catching a hierarchy of exceptions, re-throwing exceptions, and how and why you might decide to throw a different exception instead. We then discuss best practices for dealing with exceptions, including the importance of exception-safe code using the copy-before-release idiom and the execute-around idiom.
Scope is an important and integral part of the C++ language. This module investigates various scope-related issues including namespaces, nested types, and static members. The module also shows how to implement various related design patterns.
This module explores various design patterns to illustrate how to use association and delegation to good effect in C++. We show how to use the Composite pattern to represent whole-part relationships; how to use the Object Adapter pattern to enable classes to work together despite incompatible interfaces; how to use the Proxy pattern to define lightweight placeholders for costly objects; and how to use the Null Object pattern to provide an object as a surrogate.