This guide provides a comprehensive explanation of Object-Oriented programming in modern C++ (C++17/20). The content has been completely updated to reflect contemporary best practices including:
- Smart pointers and modern memory management
- Move semantics and rvalue references
- Const-correctness and RAII principles
- Modern constructor patterns and initializer lists
- Standard Library containers and algorithms
- Type safety and compiler-assisted correctness
The guide emphasizes pedagogical clarity over so-called "real world examples". Still, it shows current best practices and code patterns.
Major Update: Complete modernization to C++17/20 standards with comprehensive improvements.
- ✅ All code examples updated to modern C++ (C++17/20)
- ✅ Smart pointers throughout (no more raw
new/delete) - ✅ Move semantics and rvalue references explained
- ✅ Const-correctness and RAII principles emphasized
- ✅ Fully compilable example code in
examples/directory - ✅ CMakeLists.txt for easy building
- ✅ Modern C++ Overview guide for quick reference
- ✅ Best Practices document with industry patterns
- ✅ Compilation scripts for all examples
This was the first edition of this guide. It used outdated C++ patterns that no longer reflect modern best practices.
- ✅ Object-Oriented fundamentals (classes, objects, abstraction)
- ✅ Encapsulation and access control
- ✅ Inheritance and class hierarchies
- ✅ Polymorphism and virtual functions
- ✅ Move semantics and modern memory management
If you have any feedback regarding the contents of this guide, such as corrections or possible additions, please create a new issue here. This will allow me to keep track of future modifications that need to be implemented. I greatly appreciate the valuable feedback I have received from users.
- Facundo Martínez © 2026
The content of this repository is licensed under CC BY-NC-SA 4.0
If you are interested in using the contents of this repository for commercial purposes, please contact me privately to reach an agreement.
I love creating free content for everyone. If my articles and repos were useful to you, please consider supporting me on Github Sponsors, Ko-Fi or PayPal. It would be of great help and I would really appreciate it!
