DM852 - Introduction to Generic Programming, 2019

Course description

Schedule

(Official schedule)

Week Day Notes and Material (Additional) Reading
6 Monday Course introduction (slides), C++ introduction (slides, code)
Tuesday C++ introduction (cont.), Values, types, objects, and variables (slides, code) ([TMPL] Appendix A, The ODR)
Thursday (no class) Exercise suggestions
Friday Values, types, objects, and variables (cont.), Operators, overloading, and friends (slides, code)
7   (no classes) Exercises
8 Monday (no class)
Tuesday Regular Types (slides) Inheritance and polymorphism (slides, code), Exceptions (slides, code), [DeSt], [DA]
Thursday Exceptions (cont.), Conversions, Value Categories, and Moving (slides, code), [TMPL] Appendix B, [BS:10]
Friday (cancelled)
9 Tuesday Conversions, Value Categories, and Moving (cont.)
Thursday  
Friday  
10 Monday  
Tuesday  
Thursday  
Friday  
11 Tuesday  
Thursday  
Friday  
12 Tuesday  
Thursday  
Friday  
13 Tuesday  
Thursday  
Friday  
?? ?? Exam project deadline

Literature

  • [TMPL] C++ Templates, The Complete Guide, 2nd Edition
    Authors: David Vandevoorde, Nicolai Josuttis, Douglas Gregor
    Year: 2017
    ISBN: 9780321714121
  • [DeSt] Fundamentals of Generic Programming. James C. Dehnert and Alexander Stepanov. In Generic Programming, LNCS 1766, Spring, 2000. [DOI | TR]
    (see also Revisiting Regular Types, Titus Winters)
  • [DA] Exception-Safety in Generic Components, David Abrahams, 2001

  • [BS:10] “New” Value Terminology, Bjarne Stroustrup, 2010

Additional Resources

Installing GCC \(\geq\) 6

Note, if you use Ubuntu 18.04, the default GCC package is already new enough. That is, simply do:

sudo apt-get install g++

If you want to try an even newer version, see below.

Ubuntu

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

From Source

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

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

    wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.gz
    tar xzf gcc-8.2.0.tar.gz
    
  2. Download prerequisites:

    cd gcc-8.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=-8 --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