Computer Science

Faculty of Engineering, LTH

Denna sida på svenska This page in English


The slides that I show during the lectures will appear below as the course proceeds. 

Lecture topics

 Note that the lecture slides contain topics and suggested reading for the following lecture.

Subject Slides

Introduction: functions

L2Introduction cont'd: data types and variables(pdf)
L3Modularity: source code organization and error handling(pdf)
L5Resource management(pdf)
L6Generic programming: standard algorithms and iterators(pdf)

Templates and function objects

L8Classes: const overloading and inheritance(pdf)
L9More about resource management and the standard library(pdf)

The project. More about the standard library


Low level details and loose ends



Code examples from, or related to, the lectures

Lecture 1: : example of implicit arithmetic conversion.

Lecture 2: : a small example demonstrating how the same object can be interpreted as different types.

Lecture 3: : example of Argument Dependent Lookup

Lecture 4: : example: default, copy, converting and delegating constructors.

Lecture 5: : example type cast to change the value of an object by changing its type.

Lecture 6: : a minimal function template example : an example of a stateful function object : an example of the difference between capture by value and by reference

Lecture 7: : examples of deduction of template type parameters

Lecture 9: : example of resource management for containers : example of "virtual dispatch" at compile-time, and "mixins"

Lecture 10: : example of a variadic template : example of compile-time computation of n! : example of the standard reference wrapper and std::ref : example of compile_time rational numbers using std::ratio : example of the time representation classes : example of metaprogramming for selecting which overload to be used for a particular type