lunduniversity.lu.se

Computer Science

Faculty of Engineering, LTH

Denna sida på svenska This page in English

Lectures

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
L1

Introduction: functions

pdf
L2Introduction cont'd: data types and variablespdf
L3Modularity: source code organization and error handlingpdf
L4Classespdf
L5Resource managementpdf
L6Generic programming: standard algorithms and iteratorspdf
L7

Templates and function objects

pdf
L8Classes: const overloading and inheritancepdf
L9More about resource management and the standard librarypdf
L10

Examples. More about the standard library

pdf
L11

Low level details and loose ends

pdf
L12Recap and about the project pdf
L13,
L14
no lecture

Examples

Code examples from, or related to, the lectures

Lecture 2:

unsigned.cc : example of implicit arithmetic conversion.

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

Lecture 3:

example_adl.cc : example of Argument Dependent Lookup

Lecture 4:

ctors.cc : example: default, copy, converting and delegating constructors.

Lecture 5:

typecast.cc : example type cast to change the value of an object by changing its type.

Lecture 6:

print.cc : a minimal function template example

fn-state.cc : an example of a stateful function object

lambda.cc : an example of the difference between capture by value and by reference

Lecture 9:

example_copying.cc : example of resource management for containers 

Lecture 10:

ratio.cc : example of compile_time rational numbers using std::ratio

chrono.cc : example of the time representation classes

ref.cc : example of the standard reference wrapper and std::ref 

meta.cc : example of compile-time computation of n!

variadic.cc : example of a variadic template

enable_if.cc : example of metaprogramming for selecting which overload to be used for a particular type

Lecture 11:

arrayp.cc : example passing a pointer to an array with the array size as part of the type to avoid array decay

multi-array.cc : example of multi-dimensional array

multi-array-mem.cc : example of the difference of an array of char* and an array of char[6]