Namespaces
Variants
Views
Actions

std::pointer_safety

From cppreference.com
< cpp‎ | memory
Revision as of 16:12, 2 November 2012 by P12bot (Talk | contribs)

 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
Dynamic memory management
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Allocators
Garbage collection support
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
pointer_safety
(C++11)(until C++23)
(C++11)(until C++23)



 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <memory>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
enum class pointer_safety {

     relaxed,
     preferred,
     strict

};
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

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

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

See also

Template:cpp/memory/gc/dcl list get pointer safety