diff --git a/01.Introduction.pdf b/01.Introduction.pdf index 737512c..51694f2 100644 Binary files a/01.Introduction.pdf and b/01.Introduction.pdf differ diff --git a/02.Basic_Concepts_I.pdf b/02.Basic_Concepts_I.pdf index 6f33b27..b56ceb0 100644 Binary files a/02.Basic_Concepts_I.pdf and b/02.Basic_Concepts_I.pdf differ diff --git a/03.Basic_Concepts_II.pdf b/03.Basic_Concepts_II.pdf index b767954..94dbeb9 100644 Binary files a/03.Basic_Concepts_II.pdf and b/03.Basic_Concepts_II.pdf differ diff --git a/04.Basic_Concepts_III.pdf b/04.Basic_Concepts_III.pdf index c2c8345..c7e56aa 100644 Binary files a/04.Basic_Concepts_III.pdf and b/04.Basic_Concepts_III.pdf differ diff --git a/06.Basic_Concepts_V.pdf b/06.Basic_Concepts_V.pdf index 0a82fa9..798bb82 100644 Binary files a/06.Basic_Concepts_V.pdf and b/06.Basic_Concepts_V.pdf differ diff --git a/07.Object_Oriented_I.pdf b/07.Object_Oriented_I.pdf index 02b8bb6..3d47676 100644 Binary files a/07.Object_Oriented_I.pdf and b/07.Object_Oriented_I.pdf differ diff --git a/09.Templates_I.pdf b/09.Templates_I.pdf index 249b06c..79b40b7 100644 Binary files a/09.Templates_I.pdf and b/09.Templates_I.pdf differ diff --git a/10.Templates_II.pdf b/10.Templates_II.pdf index 6e27692..53e27fa 100644 Binary files a/10.Templates_II.pdf and b/10.Templates_II.pdf differ diff --git a/11.Translation_Units_I.pdf b/11.Translation_Units_I.pdf index ef06f7b..a8fa827 100644 Binary files a/11.Translation_Units_I.pdf and b/11.Translation_Units_I.pdf differ diff --git a/12.Translation_Units_II.pdf b/12.Translation_Units_II.pdf index cf3423c..630336a 100644 Binary files a/12.Translation_Units_II.pdf and b/12.Translation_Units_II.pdf differ diff --git a/13.Code_Convention.pdf b/13.Code_Convention.pdf index 0355c54..4818877 100644 Binary files a/13.Code_Convention.pdf and b/13.Code_Convention.pdf differ diff --git a/14.Ecosystem_I.pdf b/14.Ecosystem_I.pdf index 5ca43bb..408dba9 100644 Binary files a/14.Ecosystem_I.pdf and b/14.Ecosystem_I.pdf differ diff --git a/15.Ecosystem_II.pdf b/15.Ecosystem_II.pdf index 0392204..b18b1dc 100644 Binary files a/15.Ecosystem_II.pdf and b/15.Ecosystem_II.pdf differ diff --git a/16.Utilities.pdf b/16.Utilities.pdf index 0ca7c8d..f7a9cfa 100644 Binary files a/16.Utilities.pdf and b/16.Utilities.pdf differ diff --git a/17.Iterators_Containers_Alg.pdf b/17.Iterators_Containers_Alg.pdf index 30a5a5b..f369144 100644 Binary files a/17.Iterators_Containers_Alg.pdf and b/17.Iterators_Containers_Alg.pdf differ diff --git a/18.Advanced_Topics_I.pdf b/18.Advanced_Topics_I.pdf index 5ec989b..439f804 100644 Binary files a/18.Advanced_Topics_I.pdf and b/18.Advanced_Topics_I.pdf differ diff --git a/19.Advanced_Topics_II.pdf b/19.Advanced_Topics_II.pdf index 2bc6ec9..319ac57 100644 Binary files a/19.Advanced_Topics_II.pdf and b/19.Advanced_Topics_II.pdf differ diff --git a/20.Optimization_I.pdf b/20.Optimization_I.pdf index 976f571..5972502 100644 Binary files a/20.Optimization_I.pdf and b/20.Optimization_I.pdf differ diff --git a/21.Optimization_II.pdf b/21.Optimization_II.pdf index dc48a2b..bc0941f 100644 Binary files a/21.Optimization_II.pdf and b/21.Optimization_II.pdf differ diff --git a/22.Optimization_III.pdf b/22.Optimization_III.pdf index a9502e3..f84ccee 100644 Binary files a/22.Optimization_III.pdf and b/22.Optimization_III.pdf differ diff --git a/README.md b/README.md index cbc383e..4145f08 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ If you enjoy the course or you find it useful, please add a **Star** | **21** | **[Optimization II - Code Optimization](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/21.Optimization_II.pdf)** | Arithmetic optimizations, memory optimizations, etc. | | **22** | **[Optimization III - Non-Coding Optimizations and Benchmarking](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/22.Optimization_III.pdf)** | Compiler optimizations, profiling and benchmarking tools | -***ALL-IN-ONE BOOK***: **[modern-cpp.pdf](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/modern-cpp.pdf)** +***ALL-IN-ONE BOOK***: **[modern-cpp.pdf](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/modern-cpp.pdf)** (could be a few commits behind) ## TOPICS IN DETAILS @@ -86,7 +86,7 @@ If you enjoy the course or you find it useful, please add a **Star** * **Books and References** * **The Course** -**[2. Basic Concepts I - Fundamental Types](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/02.Basic_Concepts_I.pdf)** +**[2. Basic Concepts I - Fundamental Types and Operations](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/02.Basic_Concepts_I.pdf)** * **Preparation**: What compiler should I use?, What editor/IDE compiler should I use?, How to compile? * **Hello World**: I/O Stream @@ -97,17 +97,19 @@ If you enjoy the course or you find it useful, please add a **Star** **[3. Basic Concepts II - Integral and Floating-point Types](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/03.Basic_Concepts_II.pdf)** -* **Integral Data Types**: Fixed width integers, `size_t` and`ptrdiff_t`, When use signed/unsigned integer? Promotion, Truncation, Undefined behavior +* **Integral Data Types**: Fixed width integers, `size_t` and`ptrdiff_t`, Signed/Unsigned integer characteristics, Promotion, Truncation, Undefined behavior * **Floating-point Types and Arithmetic**: IEEE Floating-point Standard and Other Representations, Normal/Denormal values, Infinity, Not a Number (`NaN`), Machine Epsilon, Units at the Last Place (ULP), Cheatsheet, Summary, Arithmetic Properties, Detect Floating-point Errors * **Floating-point Issues**: Catastrophic cancellation, Floating-point comparison **[4. Basic Concepts III - Entities and Control Flow](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/04.Basic_Concepts_III.pdf)** +* **Entities** +* **Declaration and Definition** * **Enumerators** * **`struct`, Bitfield, `union`** -* **Control Flow**: `if` Statement, `for` Loop, Range-base `for` loop, `switch`, `goto` +* **Control Flow**: `if` Statement, `for` Loop, Range-base `for` loop, `switch`, `goto`, Avoid unused variable warning `[[maybe unused]]` -**[5. Basic Concepts IV - Memory Management](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/05.Basic_Concepts_IV.pdf)** +**[5. Basic Concepts IV - Memory Concepts](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/05.Basic_Concepts_IV.pdf)** * **Heap and Stack**: Stack Memory, `new`, `delete`, Non-allocating placement allocation, Non-throwing allocation, Memory leak * **Initialization**: Variable initialization, Uniform initialization, Fixed-size array initialization, Structure initialization, Dynamic memory initialization @@ -119,17 +121,17 @@ If you enjoy the course or you find it useful, please add a **Star** **[6. Basic Concepts V - Functions and Preprocessing](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/06.Basic_Concepts_V.pdf)** -* **Declaration and Definition** -* **Functions**: Pass by-value, Pass by-pointer, Pass by-reference, Function signature and Overloading, Overloading and `=delete`, Default parameters, Attributes +* **Functions**: Pass by-value, Pass by-pointer, Pass by-reference, Function signature and Overloading, Overloading and `=delete`, Default parameters, Attributes `[[attributes]]` * **Function Pointer and Function Objects** -* **Lambda Expressions**: Capture list, Other features, Capture list and classes -* **Preprocessing**: Preprocessors, Common errors, Useful macro, Stringizing operator (`#`), `#error` and `warning`, `#pragma`, Token-Pasting Operator (`##`), Variadic Macro +* **Lambda Expressions**: Capture list, Parameters, Composability, `constexpr/consteval`, `template`, `mutable`, `[[nodiscard]]`, Capture list and classes +* **Preprocessing**: Preprocessors, Common errors, Source location macros, Conditional compiling macros, Stringizing operator (`#`), `#error` and `warning`, `#pragma`, Token-Pasting Operator (`##`), Variadic Macro **[7. Object-Oriented Programming I - Class Concepts](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/07.Object_Oriented_I.pdf)** * **C++ Classes**: RAII Idiom -* **Class Hierarchy**: Access specifiers, Inheritance access specifiers -* **Class Constructor**: Default constructor, Class initialization, Uniform initialization, Delegate constructor, `explicit` keyword, `[[nodiscard]]` and classes +* **Class Hierarchy** +* **Access specifiers**: Inheritance access specifiers, When use `public/protected/private` for data members? +* **Class Constructor**: Default constructor, Class initialization, Uniform initialization for pbjects, Delegate constructor, `explicit` keyword, `[[nodiscard]]` and classes * **Copy Constructor** * **Class Destructor** * **Defaulted Constructors, Destructor, and Operators** (`= default`) @@ -144,22 +146,22 @@ If you enjoy the course or you find it useful, please add a **Star** **[9. Templates and Meta-programming I - Function Templates and Compile-Time Utilities](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/09.Templates_I.pdf)** -* **Function Template**: Overview, Template parameters, Template parameter - default value, Specialization, Overloading +* **Function Template**: Overview, Template parameters, Template parameter - default value, Overloading, Specialization * **Template Variable** * **Template Parameter Types**: Generic Type Notes, `auto` Placeholder, Class template parameter type, Array and pointer types, Function type * **Compile-Time Utilities**: `static_assert`, `decltype` Keyword, `using` Keyword * **Type Traits**: Overview, Type traits library, Type manipulation -**[10. Templates and Meta-programming II -  - Class Templates and SFINAE](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/10.Templates_II.pdf)** +**[10. Templates and Meta-programming II -  Class Templates and SFINAE](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/10.Templates_II.pdf)** -* **Class Template**: Class specialization, Template class constructor +* **Class Template**: Class specialization, Template class constructor, Constructor template automatic deduction (CTAD) * **Class Template - Advanced Concepts**: Class + Function - Specialization, Dependent Names - `typename` and `template` Keywords, Class template hierarchy and `using`, `friend` Keyword, Template Template Arguments * **Template Meta-Programming** * **SFINAE: Substitution Failure Is Not An Error**: Function SFINAE, Class SFINAE, Class + Function SFINAE * **Variadic Template**: Folding Expression, Variadic class template * **C++20 Concepts**: Overview, `concept` Keyword, `requires` Clause, `requires` Expression, `requires` Expression + Clause, `requires` Clause + Expression, `requires` and `constexpr`, Nested `requires` -**[11. Translation Units I](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/11.Translation_Units_I.pdf)** +**[11. Translation Units I - Linkage and One Definition Rule](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/11.Translation_Units_I.pdf)** * **Basic Concepts**: Translation unit, Local and global scope, Linkage * **Storage Class and Duration**: Storage duration, Storage class, `static` and `extern` keywords, Internal/External linkage examples @@ -171,7 +173,7 @@ If you enjoy the course or you find it useful, please add a **Star** * **ODR - Class Template**: Cases, `extern` keyword * **ODR Undefined Behavior and Summary** -**[12. Translation Units II](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/12.Translation_Units_II.pdf)** +**[12. Translation Units II - Include, Module, and Namespace](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/12.Translation_Units_II.pdf)** - **`#include` Issues**: Forward declaration, Include guard, Circular dependencies, Common linking errors - **C++20 Modules**: Overview, Terminology, Visibility and Reachability, Module unit types, Keywords, Global module fragment, Private module fragment, Header module unit, Module partitions @@ -185,7 +187,7 @@ If you enjoy the course or you find it useful, please add a **Star** * **`#include`** * **Macro and Preprocessing** * **Namespace** -* **Variables** +* **Variables and Arithmetic Types** * **Functions** * **Structs and Classes** * **Control Flow** @@ -195,20 +197,20 @@ If you enjoy the course or you find it useful, please add a **Star** * **Readability and Formatting** * **Code Documentation** -**[14. Ecosystem I](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/14.Ecosystem_I.pdf)** +**[14. Ecosystem I - Debugging](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/14.Ecosystem_I.pdf)** * **Debugging** * **Assertion** -* **Execution debugging** +* **Execution debugging**: Breakpoints, Watchpoints / Catchpoints, Control Flow, Stack and Info, Print, Disassemble * **Memory Debugging**: `valgrind`, Stack protection * **Sanitizers**: Address sanitizer, Leak sanitizer, Memory sanitizers, Undefined behavior sanitizer * **Debugging Summary** * **Compiler Warnings** * **Static Analysis** -* **Code Testing**: Unit test, Code coverage, Fuzz testing +* **Code Testing**: Unit test, Test-Driven Development (TDD), Code coverage, Fuzz testing * **Code Quality**: `clang-tidy` -**[15. Ecosystem II](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/15.Ecosystem_II.pdf)** +**[15. Ecosystem II - Cmake and Other Tools](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/15.Ecosystem_II.pdf)** - **CMake**: `cmake` and `ctest` - **Code Documentation**: `doxygen` @@ -218,11 +220,11 @@ If you enjoy the course or you find it useful, please add a **Star** **[16. Utilities](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/16.Utilities.pdf)** * **I/O Stream**: Manipulator, `ofstream/ifstream` -* **Math Libraries** * **Strings**: `std::string`, Conversion from/to numeric values, `std::string_view`, `std::format`, `std::print` +* **Math Libraries** * **Random Number**: Basic Concepts, C++ ``, Seed, PRNG period and quality, Distribution, Quasi-random * **Time Measuring**: Wall-Clock time, User time, System time -* **Std Template Classes**: `std::byte` `std::pair`, `std::tuple`, `std::variant`, `std::optional`, `std::any` +* **Std Template Classes**: `std::pair`, `std::tuple`, `std::variant`, `std::optional`, `std::any`, `std::stacktrace` * **Filesystem Library**: Query methods, Modify methods **[17. Containers, Iterators, and Algorithms](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/17.Iterators_Containers_Alg.pdf)** @@ -239,7 +241,7 @@ If you enjoy the course or you find it useful, please add a **Star** **[18. Advanced Topics I](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/18.Advanced_Topics_I.pdf)** -* **Move Semantic**: `lvalues` and `rvalues` references, Move semantic, Compiler implicitly declared, `std::move` +* **Move Semantic**: `lvalues` and `rvalues` references, Move semantic, `std::move`, Class Declaration Semantic * **Universal Reference and Perfect Forwarding**: Universal reference, Reference collapsing rules, Perfect forwarding * **Value Categories** * **`&`, `&&` Ref-qualifiers and `volatile` Overloading** @@ -249,7 +251,7 @@ If you enjoy the course or you find it useful, please add a **Star** **[19. Advanced Topics II](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/19.Advanced_Topics_II.pdf)** -- **Undefined Behavior** +- **Undefined Behavior:** Common cases, Detecting undefined behavior - **Error Handling**: C++ Exceptions, Defining custom exceptions, `noexcept` keyword, Memory allocation issues, Alternative error handling approaches - **C++ Idioms**: Rule of zero/three/five, Singleton, PIMPL, CRTP, Template Virtual Functions - **Smart pointers**: `std::unique_ptr`, `std::shared_ptr`, `std::weak_ptr` @@ -267,16 +269,16 @@ If you enjoy the course or you find it useful, please add a **Star** * **I/O Operations**: `printf`, Memory mapped I/O, Speed up raw data loading * **Memory Optimizations**: Heap memory, Stack memory, Cache utilization, data alignment, Memory Prefetch * **Arithmetic**: Data types, Operations, Conversion, Floating-point, Compiler intrinsic functions, Value in a range, Lookup table -* **Control Flow**: Loop hoisting, Loop unrolling, Branch hints, Compiler hints, Recursion +* **Control Flow**: Loop hoisting, Loop unrolling, Branch hints `[[likely/unlikely]]`, Compiler hints `[[assume]]`, Recursion * **Functions**: Function call cost, Argument passing, Function optimizations, Function inlining, Pointers aliasing -* **C++ Objects**: Object RAII optimizations +* **Object-Oriented Programming** * **Std Library and Other Language Aspects** **[22. Optimization III - Non-Coding Optimizations and Benchmarking](https://github.com/federico-busato/Modern-CPP-Programming/blob/master/22.Optimization_III.pdf)** * **Compiler Optimizations**: About the compiler, Compiler optimization flags, Linker optimization flags, Architecture flags, Help the Compiler to produce better code, Profile guided optimization (PGO), Post-Processing Binary Optimizer * **Compiler Transformation Techniques** -* **Libraries and Data Structures**: External libraries, Std library +* **Libraries and Data Structures**: External libraries * **Performance Benchmarking**: What to test?, Workload/Dataset quality, Cache behavior, Stable CPU performance, Program, Multi-threads considerations, Program memory layout, Measurement overhead, Compiler optimizations, Metric evaluation * **Profiling**: `gprof`, `uftrace`, `callgrind`, `cachegrind`, `perf` Linux profiler * **Parallel Computing**: Concurrency vs. Parallelism, Performance scaling, Gustafson’s Law, Parallel programming languages @@ -296,8 +298,6 @@ Online compiler and execution: [CompilerExplorer](https://godbolt.org/) If you find any typo, conceptual error, or section to improve, please report them by using the `issue` panel. - - ## Author `Federico Busato` diff --git a/modern-cpp.pdf b/modern-cpp.pdf index 415b991..d20b1aa 100644 Binary files a/modern-cpp.pdf and b/modern-cpp.pdf differ