Namespaces
Variants
Views
Actions

std::pointer_safety

From cppreference.com
< cpp‎ | memory
 
 
 
Dynamic memory management
Uninitialized storage
(C++17)
(deprecated since c++17)
(deprecated since c++17)
(deprecated since c++17)
Garbage collection support
pointer_safety
(C++11)
Miscellaneous
(C++11)
(C++11)
C Library
Low level memory management
 
Defined in header <memory>
enum class pointer_safety {

     relaxed,
     preferred,
     strict

};
(since C++11)

The scoped enumeration type pointer_safety lists the pointer safety modes supported by C++

[edit] Enumeration constants

pointer_safety::strict Only safely-derived pointers (pointers to objects allocated with new or subobjects thereof) may be dereferenced or deallocated. Garbage collector may be active.
pointer_safety::preferred All pointers are considered valid and may be dereferenced or deallocated. A reachability-based leak detector may be active
pointer_safety::relaxed All pointers are considered valid and may be dereferenced or deallocated

[edit] See also

returns the current pointer safety model
(function) [edit]