Hide menu

TDDD38 Advanced Programming in C++

seminars

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).

If you have questions during the seminars you can use the builtin "Raise Hand" feature in Zoom and wait for me to acknowledge you. You can then ask your question via microphone. If you wish to ask questions through a microphone it is important that you wear headphones and is in a silent setting. You can also write your question to me in the chat. I will then read your question out loud followed by my answer.

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.

Recording lectures

In general we will not record the lectures/seminars, and students will not be allowed to record the lectures/seminars either. If you want to know why check this page.

Slides

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

Go to latest seminar

Intro lecture 
Jan 19  

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

Exercises:


Seminar 1 
Jan 26  

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

Exercises:

Recommended reading:

Useful tools:

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


Seminar 2 
Feb 2  

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

Example on copy elision

Reading material:

Exercises:


Seminar 3 
Feb 8  

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

Exercises:


Seminar 4 
Feb 16  

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

Exercises:

C++-20 info:

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 5 
Feb 23  

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

Exercises:


Seminar 6 
Mar 2  

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

Examples:

  • sum.cc (SFINAE techniques with comments)

Exercises:


Seminar 7 
Mar 31  

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

Exercises:


Seminar 8 
Apr 7  

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

Exercises:

Useful tools:

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


Seminar 9 
Apr 14  

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

Exercises:


Seminar 10 
Apr 21 

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 11 
Apr 28  

Introduction to C++20
Introduction to the big four of C++20: Concepts, Ranges, Modules and Coroutines. This seminar primarily focuses on concepts and ranges.

Highly recommended links:

Learn more:


Seminar 12 
May 5  

Dynamic Linking (Given by Filip Strömbäck)
What is dynamic linking? How does it work? What are the advantages and disadvantages with using dynamic linking?

Material
The code and all other material related to this lecture can be found here. This material cover the code that was used during the lecture, notes and also some slides for reference. If you have any questions you can E-mail filip.stromback@liu.se and he will happily answer your questions.

Slides from previous year


Seminar 11 
Dec 2  

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

Exercises:

Reading material:


Exam lecture 
Dec 16  

Example exam
Walkthrough of the new exam format. General tips for the exam and discussion on how the exam is assessed.

Video Link
Since the exam is back to being an on-campus exam this lecture was recorded in order for everyone to get the relevant information. You can find it here.

Seminars from previous years


Seminar ??? 
2020-12-10

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

Material
The code and all other material related to this lecture can be found in this tar-archine. This material cover the code that will be used during the lecture, notes and also some slides for reference. If you have any questions you can E-mail filip.stromback@liu.se and he will happily answer your questions.


Seminar 12.5 
???

Multithreading in C++ (updated with file references 2021-05-21 at 16:15, refresh the PDF-file)) (Given by Klas Arvidsson)
std::thread, std::mutex, promise and future, condition variables, packaged task, async, execution policy (multithreaded STL algorithms)

Examples:

  • The examples from the lecture can be found here.


Page responsible: Christoffer Holm
Last updated: 2022-05-05