Memory & Resources
Master C++'s ownership model — from raw pointers through smart pointers and move semantics — to write code that never leaks.
Pointers & References
Pointers: Addresses, Dereferencing & Arithmetic
Understand pointers as memory addresses, learn address-of and dereference operators, pointer arithmetic within arrays, const correctness with pointers, and when raw pointers are still appropriate in modern C++.
References: Lvalue, Rvalue & Pitfalls
Explore lvalue and rvalue references, understand C++ value categories, learn reference collapsing rules and forwarding references, and avoid dangling reference bugs.
Dynamic Memory: new, delete & Their Dangers
Learn how dynamic allocation works with new and delete, understand the dangers of memory leaks, double-free, and use-after-free, and discover why modern C++ should contain zero raw new/delete.
Smart Pointers
std::unique_ptr: Exclusive Ownership
Learn how std::unique_ptr provides zero-overhead exclusive ownership, how to use make_unique, custom deleters for C resources, and factory function patterns.
shared_ptr, weak_ptr & Ownership Graphs
Understand reference-counted shared ownership with shared_ptr, break cycles with weak_ptr, learn about control blocks and aliasing, and know when shared_ptr is the wrong choice.
Move Semantics & RAII
Move Semantics & std::move
Understand the problem move semantics solves, how std::move is a cast (not a move), implement move constructors and move assignment, and learn why noexcept is critical for container performance.
Perfect Forwarding & std::forward
Understand why named rvalue references are lvalues, learn the canonical forwarding pattern with std::forward, and see how emplace_back uses variadic forwarding to construct objects in-place.
RAII: The Fundamental Resource Pattern
Learn RAII (Resource Acquisition Is Initialization) — the core C++ pattern for exception-safe resource management. Implement RAII wrappers, understand lock_guard and scoped_lock, and learn why RAII types must be move-only or ref-counted.