Statements (83)
Predicate | Object |
---|---|
gptkbp:instance_of |
gptkb:engine
|
gptkbp:bfsLayer |
3
|
gptkbp:bfsParent |
gptkb:C++
|
gptkbp:appointed_by |
gptkb:std::make_unique()
|
gptkbp:can_be |
copied
moved |
gptkbp:can_be_used_with |
array types
reset() method array types (std::unique_ptr< T[]>) custom deleters lambda expressions for custom deletion std::make_unique() for easier allocation lambda functions as custom deleters std::move() for transferring ownership std::shared_ptr for resource management std::unique_ptr< T, Custom Deleter> std::unique_ptr< T[]> for array types |
gptkbp:can_create |
std::unique_ptr< T, Deleter>
|
gptkbp:class |
type-safe ownership
a type parameter for the managed type |
gptkbp:constructed_in |
custom deleters
raw pointer |
gptkbp:defines |
<memory> header
|
gptkbp:exported_to |
gptkb:theorem
|
gptkbp:features |
C++11 and later
|
gptkbp:has_transformation |
gptkb:std::shared_ptr
std::shared_ptr using std::move() |
gptkbp:hyper_threading |
gptkb:theorem
|
gptkbp:is_a_solution_for |
memory ownership issues
|
gptkbp:is_compared_to |
gptkb:std::auto_ptr
|
gptkbp:is_compatible_with |
std::move() function
|
gptkbp:is_designed_to |
lightweight and efficient
|
gptkbp:is_effective_against |
manual memory management
memory leaks double deletion errors |
gptkbp:is_implemented_in |
resource management patterns
|
gptkbp:is_often_used_in |
gptkb:std::auto_ptr
factory functions resource management in C++ applications std::shared_ptr for shared ownership |
gptkbp:is_part_of |
gptkb:C++_Core_Guidelines
gptkb:Library RAII (Resource Acquisition Is Initialization) pattern modern C++ programming practices |
gptkbp:is_protected_by |
memory leaks
double deletion |
gptkbp:is_used_for |
dynamic memory management
|
gptkbp:is_used_in |
multithreaded applications
function parameters return types containers like std::vector |
gptkbp:key |
smart pointer types in C++
|
gptkbp:managed_by |
it goes out of scope
|
gptkbp:manager |
dynamic arrays
dynamic memory allocation database connections network sockets file handles thread resources custom resource types memory allocated with new memory allocated with new[] objects that require cleanup before deletion objects that require custom logging on deletion objects that require logging on deletion objects that require special cleanup objects that require thread safety on deletion objects with non-trivial destructors resources in a scope-based manner temporary objects |
gptkbp:navigable |
gptkb:theorem
|
gptkbp:part_of |
gptkb:Library
|
gptkbp:participated_in |
nullptr
|
gptkbp:provides |
exclusive ownership
|
gptkbp:released |
release() method
|
gptkbp:replaced_by |
raw pointers
|
gptkbp:restoration |
reset() method
|
gptkbp:safety_features |
raw pointers
|
gptkbp:signature_move |
gptkb:theorem
|
gptkbp:supports |
nullptr as a default constructor argument
|
gptkbp:type_of |
gptkb:engine
smart pointer in C++ |
gptkbp:weight |
gptkb:std::shared_ptr
|