Introduction to modern C++ (slides) and code samples from Lectures

 

Notes: compile with c++11 / c++14 / c++17 / c++20 switch enabled. E.g. g++ -std=c++20. If needed, add -lpthread to link against thread library.

Review material for basic C++ prerequisites (fundamental programming course level up to modern C++)

C++ Annotations (Prof. Brokken) [intro page to material, git, ...] (good and didactic reference)

 

 

L/R-values, move semantics and r-value references, perfect forwarding, auto, range-based loops, nullptr, scoped enums :

Meyers-MoveSemantics (slides)

Meyers-cpp11NotesSample.pdf slide set: slides [1-7] + [18-34]

http://www.codeproject.com/Articles/397492/Move-Semantics-and-Perfect-Forwarding-in-Cplusplus   (perfect-forwarding)

 

 

STL

- containers (vector, set, map, multi-set, multi-map, string)

- iterators

- algorithms and numeric algorithms

- lambdas

- optional

- asyncs and threads

- random and chrono libraries

 

 

Miscellaneous material:

Biggest changes in C++11 and why you should care  

Some key changes introduced in C++14, C++17 and C++20

C++ Reference (Entry + intermediate): cplusplus.com

C++ Reference (intermediate to advanced): cppreference.com

Tables with compilers, and versions, that support each modern (11,14,17,2a) C++ feature

Exception safety levels

 

 

 

 

 

 

Some suggested exercises:

- perform timing of different variations of the Big-number class usage, adopting moves where appropriate vs using copies

- implement two versions of a sample code that manages a scoresheet, e.g. for a sportive event (managing a player_name/team_name and the score). One version using a std::map< > and one using a std::vector< std::pair< >>, reimplementing the basic "map" funcionalities: insert and lookup. Compare timing.