Tag: RAII
10 posts
-
[2026] C++ shared_ptr vs unique_ptr: Smart Pointer Choice Complete Guide
shared_ptr vs unique_ptr: prefer unique_ptr by default; use shared_ptr for shared ownership. Reference counting cost, weak_ptr for cycles, and performan...
-
[2026] Finding C++ Memory Leaks: Valgrind, AddressSanitizer, and LeakSanitizer
Detect heap leaks with Valgrind memcheck, ASan+LSan, and Visual Studio CRT debug heap. Common leak patterns: new/delete mismatch, exceptions, shared_ptr...
-
[2026] C++ Copy & Move Constructors: Rule of Five, RAII, and noexcept
Rule of Five in C++: copy/move constructors and assignment, deep copy vs shallow, self-assignment, noexcept moves, copy elision, and FileHandle patterns.
-
[2026] C++ Exception Handling Complete Guide | try/catch/throw & RAII Patterns
Master C++ exceptions: standard hierarchy, catch-by-reference, exception safety guarantees (basic/strong/nothrow), RAII patterns, noexcept interaction, ...
-
[2026] C++ jthread | Auto-Join Threads Guide
C++ jthread — automatic join threads and stop_token. Describes the basics of jthread with practical examples. Start now.
-
[2026] C++ Object Lifetime: Storage Duration, RAII, and Dangling
C++ lifetime and storage duration: automatic, static, dynamic, thread_local; destruction order; temporaries; smart pointers and RAII.
-
[2026] C++ Memory Management: new/delete, Stack vs Heap, and RAII
Deep dive into C++ memory: stack vs heap, dynamic allocation with new/delete, RAII, smart pointers, and common pitfalls—new, delete[], placement new, an...
-
[2026] C++ RAII Pattern Complete Guide | Resource Acquisition Is Initialization
Master C++ RAII: acquire resources in constructors, release in destructors for automatic cleanup. Complete guide with smart pointers, lock guards, file ...
-
[2026] C++ RAII & Smart Pointers: Ownership and Automatic Cleanup
RAII in C++: acquire resources in constructors, release in destructors—plus unique_ptr, shared_ptr, weak_ptr, patterns, and common pitfalls with examples.
-
[2026] C++ Smart Pointers: unique_ptr, shared_ptr & Memory-Safe Patterns
C++ smart pointers explained: unique_ptr for exclusive ownership, shared_ptr for shared ownership, weak_ptr for cycles—examples, make_unique/make_shared...