Note that the lecture slides contain topics and suggested reading for the next lecture.
| # | Topic | Slides |
|---|---|---|
| L1 |
Introduction: functions |
|
| L2 | Introduction cont'd: data types and variables | |
| L3 | Modularity: source code organization and error handling | |
| L4 | Classes | |
| L5 | Resource management | |
| L6 | Generic programming: standard algorithms and iterators | |
| L7 |
Templates and function objects |
|
| L8 | Classes: const overloading and inheritance | |
| L9 | More about resource management and the standard library | |
| L10 |
The project. More about templates and the standard library |
|
| L11 |
Low level details and loose ends |
|
| L12 | Recap |
Code examples from, or related to, the lectures
unsigned.cc : example of implicit arithmetic conversion. Try compiling with and without errors. On my machine gives a warning for the comparison when building with -Wextra but not with -Wall.
object_value.cc : a small example demonstrating how the same object can be interpreted as different types.
example_adl.cc : example of Argument Dependent Lookup
ctors.cc : example: default, copy, converting and delegating constructors.
typecast.cc : example type cast to change the value of an object by changing its type.
ptr_overload.cc : example: example of the possibly unexpected implicit conversion of char* and overloaded functions.
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
template.cc : examples of deduction of template type parameters
example_copying.cc : example of resource management for containers
example_crtp.cc : example of "virtual dispatch" at compile-time, and "mixins"
variadic.cc : example of a variadic template
meta.cc : example of compile-time computation of n!
ref.cc : example of the standard reference wrapper and std::ref
ratio.cc : example of compile_time rational numbers using std::ratio
chrono.cc : example of the time representation classes
enable_if.cc : example of metaprogramming for selecting which overload to be used for a particular type
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]