Modern C++ Programming Course (C++03/11/14/17/20/23/26)
See the code
This open-access course is directed at those who are already familiar with C and object-oriented programming aiming for a proficiency level of C++ programming. The course covers the basics of C++ programming and moves on to advanced C++ semantics and concepts.
Key features:
If you enjoy the course or you find it useful, please add a Star
Roadmap:
| # | TITLE | MAIN FOCUS |
|---|---|---|
| 1 | Introduction (html) | History of C/C++, Areas of applications, Course introduction |
| 2 | Preparation (html) | Books, How to compile, Hello world |
| 3 | Basic Concepts I (html) | Type System, Fundamental types, and Operators |
| 4 | Basic Concepts II (html) | Integral types and arithmetic |
| 5 | Basic Concepts III (html) | Floating-point types and arithmetic |
| 6 | Basic Concepts IV (html) | Entities, Enumerators, Structures, Control flow statements |
| 7 | Basic Concepts V (html) | Heap, Stack, Pointers, References, Const properties, Conversion operators |
| 8 | Basic Concepts VI (html) | Functions, Lambda expressions, Preprocessing directives |
| 9 | Object-Oriented Programming I (html) | Class hierarchy, Constructor, Destructor, Class keywords |
| 10 | Object Oriented Programming II (html) | Polymorphism, Operators overloading |
| 11 | Templates and Meta-programming I (html) | Function template, Type traits, Compile-time utilities |
| 12 | Templates and Meta-programming II (html) | Class template, SFINAE |
| 13 | Translation Units I (html) | Linkage and One Definition Rule |
| 14 | Translation Units II (html) | Dealing with multiple translation units and files,#include, Modules |
| 15 | Code Conventions I (html) | Project organization, Code conventions intro, Entities conventions |
| 16 | Code Conventions II (html) | Template, Namespace, Modern C++, Maintainability, Naming, and Formatting conventions |
| 17 | Debugging and Testing (html) | Execution/memory debugging, Sanitizers, Hardening techniques, Unit tests, Test-Driven Development |
| 18 | Ecosystem (html) | Cmake, Documenting, and Other Tools |
| 19 | Utilities (html) | Main std libraries |
| 20 | Containers, Iterators, and Algorithms (html) | Containers, Iterators, Algorithms, Ranges |
| 21 | Advanced Topics I (html) | Move semantics, Universal reference, Type deduction |
| 22 | Advanced Topics II (html) | Error handling, C++ idioms, Smart pointers |
| 23 | Performance Optimizations I (html) | Amdahl's Law, Performance bounds, Architecture concepts (ILP, SIMD, etc.), Memory hierarchy |
| 24 | Performance Optimizations II (html) | Arithmetic optimizations, Memory optimizations, etc. |
| 25 | Performance Optimizations III (html) | Compiler optimizations, Profiling, Benchmarking tools |
| 26 | Software Design I (html) | Basic Concepts, Principles, Use cases |
| 27 | Software Design II (html) | Design Patterns and Idioms |
| 28 | Binary Size (html) | Binary size aspects |
| 29 | Build Time (html) | Build time aspects |
ALL-IN-ONE BOOK: modern-cpp.pdf (could be a few commits behind), html
3. Basic Concepts I - Type System, Fundamental Types, and Operators
void type, nullptr.auto Keyword.<=>.4. Basic Concepts II - Integral Types
size_t, ptrdiff_t, uintptr_t.5. Basic Concepts III - Floating-point Types
NaN), Machine Epsilon, Units at the Last Place (ULP), Cheatsheet, Limits and useful functions, Arithmetic properties, Special values behavior, Undefined behavior, Detect floating-point errors.6. Basic Concepts IV - Entities and Control Flow
struct, Bitfield, union: struct, Anonymous and unnamed struct, Bitfield, union.if statement, for and while loops, Range-based for loop, switch, Initializing statement, goto, Avoid unused variable warning.using-declaration, using namespace-directive, inline namespace.[[nodiscard]], [[indeterminate]], [[maybe_unused]], [[deprecated]], [[noreturn]].7. Basic Concepts V - Memory Concepts
&, struct member access, void pointer, Pointer conversion, Pointer arithmetic, Wild and dangling pointers.new, delete, Non-allocating placement allocation, Non-throwing allocation, Memory leak.Const and Constant Expressions: Constants and literals, const, constexpr, constexpr Variables, constexpr Functions, constexpr objects, consteval, constinit.if constexpr, std::is constant evaluated(), if consteval.volatile Keyword.static_cast, const_cast, reinterpret_cast, Type punning, std::bit_cast, Uniform initialization conversion, gls::narrow_cast.sizeof and alignof Operators: sizeof, alignof, sizeof/alignof operator applied to struct, [[no_unique_address]].8. Basic Concepts VI - Functions and Preprocessing
=delete, Default parameters.constexpr/consteval, template, mutable, Capture list and classes.#), #error and #warning, #pragma, Token-pasting operator ##, Variadic macro.9. Object-Oriented Programming I - Class Concepts
public/protected/private for data members?.explicit keyword.= default).this, static, const, mutable, using, friend, delete.10. Object-Oriented Programming II - Polymorphism and Operator Overloading
virtual methods, Virtual table, override keyword, final keyword, Common errors, Pure virtual method, Abstract class and interface.<, Spaceship operator <=>, Subscript operator [], Multidimensional subscript operator [], Function call operator (), static operator [] and operator (), Conversion operator T(), Return type overloading resolution, Increment and decrement operators ++/--, Assignment operator =, Stream operator <<, Operator notes.11. Templates and Meta-programming I - Function Templates and Compile-Time Utilities
auto placeholder, Function type.static_assert, using keyword, decltype keyword.12. Templates and Meta-programming II - Class Templates and SFINAE
typename and template keywords, Class template hierarchy and using, friend keyword, Template template arguments.concept keyword, requires clause, requires expression, requires expression + clause, requires clause + expression, requires and constexpr, Nested requires.13. Translation Units I - Linkage and One Definition Rule
static keyword, Anonymous namespace, extern keyword.const and constexpr: Static initialization order fiasco.inline functions/variables, constexpr and inline.extern keyword.extern keyword.14. Translation Units II - Include, Module, and Namespace
#include Issues: Include guard, Forward declaration, Circular dependencies, Common linking errors.#include: #include guard, #include syntax, Order of #include, Common header/source filename conventions.static global variables, conversions.struct vs. class, Initialization, Braced initializer lists, Special member functions, =default, =delete, Other issues, Inheritance, Style.auto.if/else, Comparison, switch, for/while.using namespace directive, Anonymous/unnamed namespace, Namespace and class design, Style.std::stacktrace.std::breakpoint.valgrind.clang-tidy.18. Ecosystem - Cmake and Other Tools
cmake and ctestdoxygen, Alternatives.std::span.std::mdspan: std::extends, Layout, std::layout_right, std::layout_left, std::layout_stride, std::layout_right_padded, std::layout_left_padded, Accessor.std::print: std::string, Conversion from/to numeric values, std::string_view, std::format, std::print.<cmath> Math Library, <limits> Numerical Limits, <numbers> Mathematical Constants.<random>, Seed, PRNG period and quality, Distribution, Recent algorithms and Performance, Quasi-random, True Random Number Generator (TRNG).std::pair, std::tuple, std::variant, std::optional, std::any.20. Containers, Iterators, and Algorithms
std::array, std::vector, std::deque, std::list, std::forward_list.std::set, std::map, std::multiset.std::stack, std::queue, std::priority_queue.std::advance, std::next, std::prev, std::distance, Container access methods, Iterator traits.std::find_if, std::sort, std::accumulate, std::generate, std::remove_if.lvalues and rvalues references, Move semantic, std::move, Class declaration semantic.&, && Ref-qualifiers and volatile Overloading.auto deduction, auto(x): Decay-copy.const Correctness.noexcept keyword, Memory allocation issues, Return code and exception summary, std::expected, Alternative error handling approaches.std::unique_ptr, std::shared_ptr, std::weak_ptr.23. Optimization I - Basic Concepts
24. Optimization II - Code Optimization
printf, Memory mapped I/O, Speed up raw data loading.constexpr vs. static constexpr, Cache utilization, Memory alignment, Memory Prefetch.[[likely]] / [[unlikely]], Signed/Unsigned integers, Loops, Loop hoisting, Loop unrolling, Assertions, Compiler hints [[assume]]/std::unreachable(), Recursion.25. Optimization III - Non-Coding Optimizations and Benchmarking
gprof, uftrace, callgrind, cachegrind, perf Linux profiler.26. Software Design I - Basic Concepts (DRAFT)
27. Software Design II - Design Patterns and Idioms (DRAFT)
nm and objdump, Bloaty, Executable packer.ninja, Compiler cache, Distributed compilation, RAM disk, Include-What-You-Use (IWYU).extern template, constexpr variable vs. template structure + static Data member, Tag dispatching, Fold expressions, C++20 concepts, auto, using type aliasing.#pragma once, Static vs. dynamic linking, Comments and formatting, External factors.ninjatracing, Templight, Build Bench, Visual Studio - CompileScore, Visual Studio - C++ Build Insights.Please see the CONTRIBUTING.md file for more information.
The Modern C++ Programming course was created in 2018 and adopted by the University of Verona, Italy. It is taught as part of the Bachelor's and Master's degree programmes in Computer Science, for three and two years respectively. The course has also been used to train interns at NVIDIA.
Have you adopted the course, or are you interested in using it in certain contexts? If so, please get in touch so that I can keep track of usage. I'm also willing to share the LaTeX source code (the Tyst version will be open-sourced on GitHub soon).
This repository is dual-licensed:
Federico Busato, federico-busato.github.io
(top 24 of 156)
1,716 followers Β· starred Dec 2023
424 followers Β· starred Nov 2023
347 followers Β· starred Nov 2023
540 followers Β· starred Jan 2024
Modern C++ Programming Course (C++03/11/14/17/20/23/26)
See the code
This open-access course is directed at those who are already familiar with C and object-oriented programming aiming for a proficiency level of C++ programming. The course covers the basics of C++ programming and moves on to advanced C++ semantics and concepts.
Key features:
If you enjoy the course or you find it useful, please add a Star
Roadmap:
| # | TITLE | MAIN FOCUS |
|---|---|---|
| 1 | Introduction (html) | History of C/C++, Areas of applications, Course introduction |
| 2 | Preparation (html) | Books, How to compile, Hello world |
| 3 | Basic Concepts I (html) | Type System, Fundamental types, and Operators |
| 4 | Basic Concepts II (html) | Integral types and arithmetic |
| 5 | Basic Concepts III (html) | Floating-point types and arithmetic |
| 6 | Basic Concepts IV (html) | Entities, Enumerators, Structures, Control flow statements |
| 7 | Basic Concepts V (html) | Heap, Stack, Pointers, References, Const properties, Conversion operators |
| 8 | Basic Concepts VI (html) | Functions, Lambda expressions, Preprocessing directives |
| 9 | Object-Oriented Programming I (html) | Class hierarchy, Constructor, Destructor, Class keywords |
| 10 | Object Oriented Programming II (html) | Polymorphism, Operators overloading |
| 11 | Templates and Meta-programming I (html) | Function template, Type traits, Compile-time utilities |
| 12 | Templates and Meta-programming II (html) | Class template, SFINAE |
| 13 | Translation Units I (html) | Linkage and One Definition Rule |
| 14 | Translation Units II (html) | Dealing with multiple translation units and files,#include, Modules |
| 15 | Code Conventions I (html) | Project organization, Code conventions intro, Entities conventions |
| 16 | Code Conventions II (html) | Template, Namespace, Modern C++, Maintainability, Naming, and Formatting conventions |
| 17 | Debugging and Testing (html) | Execution/memory debugging, Sanitizers, Hardening techniques, Unit tests, Test-Driven Development |
| 18 | Ecosystem (html) | Cmake, Documenting, and Other Tools |
| 19 | Utilities (html) | Main std libraries |
| 20 | Containers, Iterators, and Algorithms (html) | Containers, Iterators, Algorithms, Ranges |
| 21 | Advanced Topics I (html) | Move semantics, Universal reference, Type deduction |
| 22 | Advanced Topics II (html) | Error handling, C++ idioms, Smart pointers |
| 23 | Performance Optimizations I (html) | Amdahl's Law, Performance bounds, Architecture concepts (ILP, SIMD, etc.), Memory hierarchy |
| 24 | Performance Optimizations II (html) | Arithmetic optimizations, Memory optimizations, etc. |
| 25 | Performance Optimizations III (html) | Compiler optimizations, Profiling, Benchmarking tools |
| 26 | Software Design I (html) | Basic Concepts, Principles, Use cases |
| 27 | Software Design II (html) | Design Patterns and Idioms |
| 28 | Binary Size (html) | Binary size aspects |
| 29 | Build Time (html) | Build time aspects |
ALL-IN-ONE BOOK: modern-cpp.pdf (could be a few commits behind), html
3. Basic Concepts I - Type System, Fundamental Types, and Operators
void type, nullptr.auto Keyword.<=>.4. Basic Concepts II - Integral Types
size_t, ptrdiff_t, uintptr_t.5. Basic Concepts III - Floating-point Types
NaN), Machine Epsilon, Units at the Last Place (ULP), Cheatsheet, Limits and useful functions, Arithmetic properties, Special values behavior, Undefined behavior, Detect floating-point errors.6. Basic Concepts IV - Entities and Control Flow
struct, Bitfield, union: struct, Anonymous and unnamed struct, Bitfield, union.if statement, for and while loops, Range-based for loop, switch, Initializing statement, goto, Avoid unused variable warning.using-declaration, using namespace-directive, inline namespace.[[nodiscard]], [[indeterminate]], [[maybe_unused]], [[deprecated]], [[noreturn]].7. Basic Concepts V - Memory Concepts
&, struct member access, void pointer, Pointer conversion, Pointer arithmetic, Wild and dangling pointers.new, delete, Non-allocating placement allocation, Non-throwing allocation, Memory leak.Const and Constant Expressions: Constants and literals, const, constexpr, constexpr Variables, constexpr Functions, constexpr objects, consteval, constinit.if constexpr, std::is constant evaluated(), if consteval.volatile Keyword.static_cast, const_cast, reinterpret_cast, Type punning, std::bit_cast, Uniform initialization conversion, gls::narrow_cast.sizeof and alignof Operators: sizeof, alignof, sizeof/alignof operator applied to struct, [[no_unique_address]].8. Basic Concepts VI - Functions and Preprocessing
=delete, Default parameters.constexpr/consteval, template, mutable, Capture list and classes.#), #error and #warning, #pragma, Token-pasting operator ##, Variadic macro.9. Object-Oriented Programming I - Class Concepts
public/protected/private for data members?.explicit keyword.= default).this, static, const, mutable, using, friend, delete.10. Object-Oriented Programming II - Polymorphism and Operator Overloading
virtual methods, Virtual table, override keyword, final keyword, Common errors, Pure virtual method, Abstract class and interface.<, Spaceship operator <=>, Subscript operator [], Multidimensional subscript operator [], Function call operator (), static operator [] and operator (), Conversion operator T(), Return type overloading resolution, Increment and decrement operators ++/--, Assignment operator =, Stream operator <<, Operator notes.11. Templates and Meta-programming I - Function Templates and Compile-Time Utilities
auto placeholder, Function type.static_assert, using keyword, decltype keyword.12. Templates and Meta-programming II - Class Templates and SFINAE
typename and template keywords, Class template hierarchy and using, friend keyword, Template template arguments.concept keyword, requires clause, requires expression, requires expression + clause, requires clause + expression, requires and constexpr, Nested requires.13. Translation Units I - Linkage and One Definition Rule
static keyword, Anonymous namespace, extern keyword.const and constexpr: Static initialization order fiasco.inline functions/variables, constexpr and inline.extern keyword.extern keyword.14. Translation Units II - Include, Module, and Namespace
#include Issues: Include guard, Forward declaration, Circular dependencies, Common linking errors.#include: #include guard, #include syntax, Order of #include, Common header/source filename conventions.static global variables, conversions.struct vs. class, Initialization, Braced initializer lists, Special member functions, =default, =delete, Other issues, Inheritance, Style.auto.if/else, Comparison, switch, for/while.using namespace directive, Anonymous/unnamed namespace, Namespace and class design, Style.std::stacktrace.std::breakpoint.valgrind.clang-tidy.18. Ecosystem - Cmake and Other Tools
cmake and ctestdoxygen, Alternatives.std::span.std::mdspan: std::extends, Layout, std::layout_right, std::layout_left, std::layout_stride, std::layout_right_padded, std::layout_left_padded, Accessor.std::print: std::string, Conversion from/to numeric values, std::string_view, std::format, std::print.<cmath> Math Library, <limits> Numerical Limits, <numbers> Mathematical Constants.<random>, Seed, PRNG period and quality, Distribution, Recent algorithms and Performance, Quasi-random, True Random Number Generator (TRNG).std::pair, std::tuple, std::variant, std::optional, std::any.20. Containers, Iterators, and Algorithms
std::array, std::vector, std::deque, std::list, std::forward_list.std::set, std::map, std::multiset.std::stack, std::queue, std::priority_queue.std::advance, std::next, std::prev, std::distance, Container access methods, Iterator traits.std::find_if, std::sort, std::accumulate, std::generate, std::remove_if.lvalues and rvalues references, Move semantic, std::move, Class declaration semantic.&, && Ref-qualifiers and volatile Overloading.auto deduction, auto(x): Decay-copy.const Correctness.noexcept keyword, Memory allocation issues, Return code and exception summary, std::expected, Alternative error handling approaches.std::unique_ptr, std::shared_ptr, std::weak_ptr.23. Optimization I - Basic Concepts
24. Optimization II - Code Optimization
printf, Memory mapped I/O, Speed up raw data loading.constexpr vs. static constexpr, Cache utilization, Memory alignment, Memory Prefetch.[[likely]] / [[unlikely]], Signed/Unsigned integers, Loops, Loop hoisting, Loop unrolling, Assertions, Compiler hints [[assume]]/std::unreachable(), Recursion.25. Optimization III - Non-Coding Optimizations and Benchmarking
gprof, uftrace, callgrind, cachegrind, perf Linux profiler.26. Software Design I - Basic Concepts (DRAFT)
27. Software Design II - Design Patterns and Idioms (DRAFT)
nm and objdump, Bloaty, Executable packer.ninja, Compiler cache, Distributed compilation, RAM disk, Include-What-You-Use (IWYU).extern template, constexpr variable vs. template structure + static Data member, Tag dispatching, Fold expressions, C++20 concepts, auto, using type aliasing.#pragma once, Static vs. dynamic linking, Comments and formatting, External factors.ninjatracing, Templight, Build Bench, Visual Studio - CompileScore, Visual Studio - C++ Build Insights.Please see the CONTRIBUTING.md file for more information.
The Modern C++ Programming course was created in 2018 and adopted by the University of Verona, Italy. It is taught as part of the Bachelor's and Master's degree programmes in Computer Science, for three and two years respectively. The course has also been used to train interns at NVIDIA.
Have you adopted the course, or are you interested in using it in certain contexts? If so, please get in touch so that I can keep track of usage. I'm also willing to share the LaTeX source code (the Tyst version will be open-sourced on GitHub soon).
This repository is dual-licensed:
Federico Busato, federico-busato.github.io
(top 24 of 156)
1,716 followers Β· starred Dec 2023
424 followers Β· starred Nov 2023
347 followers Β· starred Nov 2023
540 followers Β· starred Jan 2024