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 | - | 無事に由来ポインタまたはNULLポインタ
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.
[編集] 例
| This section is incomplete Reason: 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. (関数テンプレート) |