DM852 - Introduction to Generic Programming

Note

This is the 2016 version of the course.

Schedule

  • Tuesdays 12:15 – 14:00, IMADAs seminar room

  • Some Thursdays (see below) 16:15 – 18:00, IMADAs seminar room or U17

Week

Day

Notes

Material

36

Tuesday

Intro, tools, [BS] Ch. 22, 2–4, most of 8, 9.5

1, 2

Thursday

[BS] Ch. 9, part of 17

3

37

Tuesday

[DA], [BS] Ch. 5, 14.3, part of 18

4, Code

38

Tuesday

[BS:10], [BS] Part of ch. 17 and 18

5, Code

Thursday

[BS] Part of ch. 19, beginning of ch. 20

6, Code

39

Tuesday

[BS] Part of ch. 20

7, Code

40

Tuesday

[BS] Part of ch. 20 and 21

8, Code

41

Tuesday

See also [AOD] and [SM]

9, Code

Thursday

(U17) (Partial) template specialization

10, Code

42

Fall break

43

No lectures

44

Tuesday

Tag dispatching and more algorithms.

11, Code

45

Tuesday

No lecture

Thursday

std::rotate, Smart pointer introduction.

Code

46

Tuesday

More smart pointers (see also [HS]), and empty base optimisation (EBO).

13, Code

47

Tuesday

Argument-depedent lookup (ADL) (see also [AK]), intrusive smart pointer, and initial graph library discussion.

14, Code

Thursday

More on polymorphism (see also beginning of [CW]), static polymorphism with CRTP, Boost.Iterator.

15, Code

48

Tuesday

SFINAE (see also [WB2] and [BF]).

16, Code

49

Tuesday

Visitors for graph algorithms (see also [BGL]).

17

50

Tuesday

Language support for concepts: Concepts TS [AS] (see also [CPP] and [AS2]).

18, Code

51

Tuesday

Projects

  • Mandatory Assignment

  • Exam Project

Literature

Additional Resources

Installing GCC 6

Ubuntu

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-6

From Source

(See also https://gcc.gnu.org/wiki/InstallingGCC)

  1. Download and unpack the sources, e.g.:

    wget ftp://gd.tuwien.ac.at/gnu/gcc/releases/gcc-6.2.0/gcc-6.2.0.tar.gz
    tar xzf gcc-6.2.0.tar.gz
    
  2. Download prerequisites:

    cd gcc-6.2.0
    ./contrib/download_prerequisites
    
  3. Configure, build, and install (see https://gcc.gnu.org/install/configure.html for information on the options), e.g.,:

    mkdir build
    cd build
    ../configure --prefix=<where you want to install it> --program-suffix=-6 --disable-multilib
    make -j <number of threads to compile with>
    make install
    

Installing the Boost Libraries

Ubuntu

Note, this may be a relatively old version.

sudo apt-get install libboost-all-dev