Hide menu

TDDD38 Advanced Programming in C++

Lectures

Lecture 2 and 3 are given as a give a quick introduction to basic C++, actually prerequisites. If already familiar with C++11, you may concider to skip lecture 2-3, but have a look at the lecture slides!

Lecture slides are linked from each topic heading. [2x2] shows miniatures, 4 slides per page. Also the larger code examples used are linked below.

Lecture plan for study period Vt1, week 4—11



Lecture 1 
21 Jan  

Introduction and overview  [2x2]
Introduction to the course. Overview C++, orientation about course content.


Lecture 2 
22 Jan  

Basic C++ (1)  [2x2]
Overview of types (fundamental, compound, aggregates), type conversion, declarations, expression, operators, statements, characters, strings, streams, string streams, file handling, functions, parameter passing, dynamic memory handling, list initialization.


Lecture 3 
23 Jan  

Basic C++ (2)  [2x2]
Overview of types (fundamental, compound, aggregates), type conversion, declarations, expression, operators, statements, characters, strings, streams, string streams, file handling, functions, parameter passing, dynamic memory handling, list initialization.

Excercises: Aggregates and List initialization


Lecture 4 
27 Jan  

Classes (1)  [2x2]  [Code example String]
Definition, deklaration; members, data members, member functions, nested types, enumerators, static members, const member functions, mutable, inline; this (expression wich gives the address for the objekt the member function has been called for); access specification (public, protected, private), friend; implicitly defined operations on class types (member access, scope operator); special member functions (default constructor, copy constructor, copy assignment operator, destructor), compiler generated verions of the special member functions; initializers, type converting constructors, explicit, type converting operator functions; recommendations for single class design.

Excercises: Aggregates and List initialization


Lecture 5 
29 Jan  

Classes (2)  [2x2]  [Code example String]

Operator overloading  [2x2]
Rules and restrictions; member or non-member?; friend or not? Overloading, optimized versions. Guidelines and recommendations for definition and overloading of operators.

Excercises: Aggregates and List initialization  |  Smart pointer


Lecture 6 
10 Feb  

Derived classes, polymorphism, RTTI (1)  [2x2]  [Code example P-E-M-C]
Derivation/inheritance; base class/subclass; singe, multiple and repeated inheritance; public, protected and private inheritance; virtuellt inheritance (virtual); protected member access; virtual function, pure virtual function, pure specifier (=0); polymorf class, abstract class; static type, dynamic type; dynamic type control, dynamic type conversion, RTTI, dynamic_cast, typeid, type_info-objects; up-cast, down-cast, cross-cast;

Excercises: Geometric objects


Lecture 7 
11 Feb  

Derived classes, polymorphism, RTTI (2)  [2x2]  [Code example P-E-M-C]

Exception handling  [2x2]
Try-block, function-try-block, throw-expression, catch-handler; exception specification (for function), exception declaration (in handler); "catch-all" handler; bad_exception; terminate(), unexpected(), uncaught_exception(), abort(); standard exceptions (exception and subclasses); user defined exceptions; recommendations for using exceptions.

Excercises: Geometric objects


Lecture 8 
24 Feb  

Templates (1)  [2x2]
Function templates, class templates; declaration, definition; template parameters, template arguments, default template parameter arguments; template instantiation, implicit instantiation, explicit instantiation; template specialization, implicit specialization, partial specialization, full specialization; function templates and overload resolution; variadic templates, parameter pack, pack expansion; type equivalence for template classes; member templates; friend and template; alias templates; dependent name; SFINAE; the name rule, reference collapsing rules, move semantics, perfect forwarding; meta programming, type traits; compilation models for template code.


Lecture 9 
26 Feb  

Templates (2)  [2x2]

Namespaces  [2x2]
Namespace, namespace members, anonymous namespaces, namespace alias, using declaration, using directive (using namespace).

Preprocessor  [2x2]
Source code inclusion, simple macros, function macros, conditional compilation.

Excercises: Policy Design for Smart Pointers  |  Character Traits


Lecture plan for study period Vt2, week 13—21



Lecture 10  
25 Mar  

C++ standard library (1)
Main emphasis on containers, iterators, algorithms, function objects, and related library support.

Introduction, overview  [2x2]
General overview. Containers, iterators, algorithms, function objects, utilities.

Standard containers  [2x2]
Sequential containers, sequential container adaptors, ordered associative containers.

Excercises: Container Design  |  Fixed Size Container  |  Indexed Set  |  Ordered List Iterators  |  Standard Library


Lecture 11  
3 Apr  

C++ standard library (2)

Iterators  [2x2]
Container iterators, inserters, stream iterators.

Standard algorithms  [2x2]
Algorithms (function) for operating on, e.g., containers, streams, etc.

Excercises: Container Design  |  Fixed Size Container  |  Indexed Set  |  Ordered List Iterators  |  Standard Library


Lecture 12  
10 Apr  

C++ standard library (3)

Function objects, lambda expression  [2x2]
Objects that can be used as functions. Important for effective use of containers and algorithms. Lambda exepressions is a way to create simple function objects. Binders, negators, function call adaptors, and standard function objects corresponding to the arithmetic, comparison, and logical operator in C++.

Excercises: Container Design  |  Fixed Size Container  |  Indexable Set  |  Ordered List Iterators  |  Standard Library


Lecture 13  
8 May  

C++ standard library (4)

Smart pointers  [2x2]
Strong and weak references; unique_ptr, shared_ptr, and weak_ptr.

Bits and pieces  [2x2]



Page responsible: Tommy Olsson
Last updated: 2014-04-09