std::declare_reachable
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <memory>
|
||
| void declare_reachable( void* p ) |
(C++11 起) | |
声明引用的对象的指针
p可达。到达的对象不会被删除由垃圾收集器,或认为是泄漏检漏仪即使所有的指针被破坏。一个对象可能被宣布可达多次,在这种情况下,多次调用std::undeclare_reachable将需要删除此属性。例如,XOR链表需要声明其可达的结点,如果执行垃圾收集启用.Original:
Declares the object referenced by the pointer
p reachable. Reachable objects will not be deleted by the garbage collector or considered to be a leak by a leak detector even if all pointers to it are destroyed. An object may be declared reachable multiple times, in which case multiple calls to std::undeclare_reachable would be needed to remove this property. For example, a XOR链表 needs to declare its nodes reachable if the implementation has garbage collection enabled.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目录 |
[编辑] 参数
| p | - | 一个安全的派生的指针或一个空指针
Original: a safely-derived pointer or a null pointer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[编辑] 返回值
(无)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 例外
可能会引发std::bad_alloc如果系统无法分配所需的内存跟踪到达的对象.
Original:
May throw std::bad_alloc if the system cannot allocate memory required to track reachable objects.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 为例
| 本节是不完整的 原因: no example |
[编辑] 另请参阅
| (C++11) |
宣布,一个对象可以回收利用 Original: declares that an object can be recycled The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) |