Hide menu

Lecture slides


This is a HTML rendering of the old lecture slides to let you search and go to a specific topic.

All on one page

Basic c++

The classic first C++ program
The C++ compilation model
Keywords and identifiers with special meaning
Data types and type conversion
Fundamental types
Compound types
Type definition
CV-qualification
Pointers
References
Pointers and dynamic memory handling
Aggregates and initializer lists
Implicit type conversion
Explicit type conversion
Declarations and definitions
Storage duration and object lifetime
Expressions and operators
Value categorization
Statements
Functions and parameter passing
Strings
Tuples

Streams and I/O

Streams
Stream class hierarchy
Using the streams library
Formatted I/O
Reading and writing standard streams
Member functions for handling stream state
Throw exceptions on stream state changes
Stream manipulators for input
Member functions for unformatted input
Formatted output flags
Member functions for unformatted output
File streams
File mode flags
String streams

Classes and single class design

Classes - introduction
Class members
Creating and operating on class objects
Definition of member functions
Special member functions
Constructors
Using constructors
Member initializers
Destructor
The this pointer
Default constructor
Type converting constructor
Copy constructor
Copy assignment operator
Copy assignment operator - straightforward implementation
Copy assignment operator - elegant version (using the "create temporary and swap" idiom)
Move semantics
Move constructor
Move assignment operator
Rules for move constructor and move assignment operator generation
Style recommendations for declaring special member functions
Utility function std::move()
Ref-qualifiers for non-static member functions
Situations where special member functions are used
Delegating constructors
Restricting and controlling object creation
Type conversion functions
Static members
Some recommendations for single class design

Derived classes and polymorphism

Derived classes
An example on an abstract base class - Person
Subclass Employee
Subclass Manager
Subclass Consultant
The using declaration in class scope
Inheritance and special member functions
The NVI pattern - Non-Virtual Interface
Initialization and destruction of objects of derived type
Using Person-Employee-Manager-Consultant
Dynamic type checking and dynamic type conversion
Dynamic type control using typeid expressions
Dynamic type conversion using dynamic_cast
Virtual base classes - class lattice - subobject lattice
Initialization and destruction of derived class objects with virtual base classes
An example of real use of virtual base classes
Comments on derived class design

Namespaces

Namespaces
Namespace member definitions
Using directive
Using declaration
Unnamed namespaces
Inline namespaces
The Interface Principle and Argument Dependent Lookup (ADL)
Namespace recommendations

Preprocessor

Preprocessor

Templates

Templates
Function templates
Function template instantiation
Explicit function template specialization
Function templates and overload resolution
Non-type template parameters
Function templates, auto and decltype
Class templates
Class template instantiation and specialization
Default template parameter arguments
Separate definitions for members of a class template
Variadic templates
Variadic emplace functions
Template parameter overview
Type equivalence
Member templates
Alias templates
Dependent names
SFINAE - Substitution Failure Is Not An Error
Utility function std::move()
Perfect forwarding
Utility function std::forward()
Policy design
Meta programming and type traits
Type classification traits
Example use of type traits

Standard library

Standard library overview
Standard library content
C++1y Standard Library
Example: containers - iterators - algorithms - function objects - streams

Containers and iterators

Standard Containers Library
Container member types
Container iterators
Sequence containers
Sequence adaptors
std::initializer_list
Utility class pair
Associative containers
Unordered associative containers
Some comments on containers library design

Algorithms

Standard Algorithms Library
Notes on standard algorithms design
reference_wrapper
Non-modifying sequence operations
Mutating sequence operations
Sorting and related operations
Set algorithms
Heap algorithms
Minimum and maximum operations
Lexicographical comparison
Permutation generators
Numeric algorithms

Function objects and lambdas

Function objects (functor) and lambda expressions
Defining function object class types
Using function objects
Function objects with state
Standard library function object classes
Lambda expressions
Non-generic lambda expressions and closure types
Generic lambda expressions (C++14)
Generic lambda expressions and closure types (C++14)
Generic lambda expressions for function parameter packs (C++14)
Function call syntax
Callable objects
Function call wrappers
Negators
Utility function std::bind
Utility function std::mem_fn
Template std::function
Summing up: Containers - Iterators - Algorithms - Function objects

Page responsible: Christoffer Holm
Last updated: 2016-01-17