Tag: unique_ptr
4 posts
-
std::unique_ptr: Exclusive Ownership, make_unique, Custom Deleters and Moving Ownership
std::unique_ptr explained: RAII, make_unique, custom deleters, arrays, move semantics, PIMPL, containers, and exception-safe factories.
-
C++14 Init Capture: Moving unique_ptr into Lambdas, Reference Init and Evaluation Time
C++14 init capture [x = expr]: auto-style deduction, when it runs, moving unique_ptr in, why std::function rejects it, [&r = x], [*this] and pack capture.
-
C++ Smart Pointers
C++ smart pointers: unique_ptr, shared_ptr, weak_ptr, make_unique, make_shared—fix circular references when memory grows despite no Valgrind leak.
-
C++ shared_ptr vs unique_ptr: Ownership, Overhead, Thread Safety and When to Use Each
shared_ptr vs unique_ptr: prefer unique_ptr by default; use shared_ptr for shared ownership. Raw pointers in C++ do not communicate ownership.