Hide menu

TDDD38 Advanced Programming in C++


The slides from the seminars and lectures will be added to this page after corresponding lecture has been given. If you wish to prepare for a seminar you may look at the preliminary slides.

Distance mode until further notice

Due to the current situation with the COVID-19 virus, all education are to be given by distance. Because of this, all seminars and lectures will be live streamed through the video conference software called Zoom until further notice. Make sure that you have a computer or a mobile device that can play sound.

Approximately 15-20 minutes before the seminar starts you will get an e-mail to your studet e-mail account. This e-mail will contain a so called meeting-id code, which is a 9 or 10-digit code which you use in the Zoom-software to connect to the lecture. You will also recieve a direct link.

Make sure that you download and install Zoom before the first lecture to avoid any complications. More instructions can be found here. Zoom is available for Windows, Mac OS, Linux, Android and iOS (among others).

The first lecture will open around 45 minutes before the start time (i.e. around 09:30, 2020-04-02), so that those who want to test the system before the lecture starts get a chance to experiment and test Zoom.

If you have questions during the seminars you can use the builtin "Raise Hand" feature in Zoom. Write your question to me in the chat and then press the "Raise Hand" button to get my attention. I will then read your question out loud followed by my answer. If you want to ask your question via a microphone rather then through chat, please write so in your chat message. If you wish to ask questions through a microphone it is important that you wear headphones and is in a silent setting.

This way of giving lectures is new to all of us and I hope that we can support each other to make this work out! Be respectful during the live streams and try to not write in the Zoom chat unnecessarily. I reserve the right to remove people from the lectures if they cause interruptions.


Note that the published slides have extra material compared to the slides shown during the seminars.

Go to latest seminar

Intro lecture 
Jan 22  

Introduction and course information
Introduction to the course and some background for the langugage.


Seminar 1 
Jan 29  

Basic C++
Basic concepts in C++ that are needed during the course.


Useful tools:

  • cdecl.org - a tool that translates complicated type declarations into english!

Seminar 2 
Feb 5  

Classes and Operator Overloading
References, classes, special member functions and operator overloading.

Example on copy elision

Reading material:


Seminar 3 
Feb 11  

Inheritance and Polymorphism
Inheritance, polymorphism, virtual functions, real-time type information (RTTI), exceptions and smart pointers.


Seminar 4 
Feb 19  

Function Templates
Function templates, nontype template parameters, explicit template specialization, template argument deduction, name lookup, overload resolution, compilation and linking, constexpr and auto.


Seminar 5 
Feb 26  

Class Templates and Variadic Templates
Class templates, partial specializations, member function templates, variadic templates, variadic recursion, static_assert, type_traits, fold expressions, namespaces.


Useful tools:

  • Compiler Explorer - a tool that lets you see the generated assembler of your code, useful to see what is actually generated from your templates (remember to add the -O2 flag).

Seminar 6 
Mar 4  

Advanced templates and SFINAE
dependent names, template-template parameters, forwarding references, SFINAE, decltype, trailing return types, expression SFINAE


  • sum.cc (SFINAE techniques with comments)


Seminar 7 
Apr 2  

Introduction to STL
Design principles of the standard template library, streams, stream flags, std::array, std::vector, std::list, std::forward_list and std::deque, cache locality, pointer invalidation


Seminar 8 
Apr 8  

STL: Iterators and Associative Containers
Iterators, iterator categories, output iterators, associative containers, container adaptors, function objects, lambda expressions


Useful tools:

  • C++ Insights - a tool that reveals things that happen behind the scenes (demonstrates compiler magic).

Preliminary Slides

Seminar 9 
Apr 16  

STL: Algorithms
std::function, std::bind, std::mem_fn, iterator utility functions, reverse and const interators, stream iterators, algorithms, usages of std::copy, modifying algorithms, std::accumulate


Seminar 10 
Apr 23  

Sum Types in C++
unions, std::optional, std::variant, std::any, union-like structs, placement new, basic variant implementation, aliasing, strict aliasing rules, std::launder

On launder() - Nicolai Josuttis
Formal explanation of why std::launder is needed.

Seminar 10.5 

Multithreading in C++ (Given by Klas Arvidsson)
std::thread, std::mutex, promise and future, condition variables, packaged task, async, execution policy (multithreaded STL algorithms)


  • The examples from the lecture can be found here.

Seminar 11 
Apr 29  

Template Design Patterns
Static polymorphism, Bridge Pattern, Generic programming, Policy pattern, allocators, Multiple inheritance, diamond problem, virtual inheritance, mixins, traits, type_traits, iterator_traits, tag dispatching, constexpr if


Seminar 12 
May 7  

The C++ ABI (Given by Filip Strömbäck)
What is an ABI, System V ABI, Microsoft ABI, different implementations of: object layout, function calls, parameter passing, return values, virtual function calls, vtables, exceptions


  • The examples from the lecture can be found here.
  • The examples are also available as a tar-archive here.

Exam lecture 
May 14  

Latest exam
Walkthrough of the latest exam. General tips for the exam and discussion on how the exam is corrected.

Page responsible: Christoffer Holm
Last updated: 2020-04-07