在线文档教程
C++
应用 | Utilities

std::pointer_safety

STD::指针[医]安全

Defined in header
enum class pointer_safety { relaxed, preferred, strict };(since C++11)

范围枚举类型pointer_safety列出C++支持的指针安全模式

枚举常数

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

另见

get_pointer_safety (C++11)returns the current pointer safety model (function)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/Memory/gc/指针[医]安全