delete expression
提供: cppreference.com
![]() | このページは、Google 翻訳を使って英語版から機械翻訳されました。 翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
Original:
Destructs object(s) previously allocated by the
新しい式</div> and releases obtained memory area
Original:
new expression
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
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.
[編集]構文
:: (オプション) delete expression | (1) | ||||||||
:: (オプション) delete [] expression | (2) | ||||||||
[編集]説明
以前
new
式で構成されたオブジェクトを破棄し、得られたメモリ領域を解放します。 expressionはnew
式への前回の呼び出しによって返されたポインタ値になる必要があります。配列の2番目のバージョンを使用しなければならないのに対し、シングルに割り当てられたオブジェクトの場合、式の最初のバージョンは、使用しなければなりません。 配置によって初期化されたオブジェクトを解放する削除式が存在しない新しい、メモリ解放関数とデストラクタを明示的に呼び出さなければなりません.Original:
Destructs objects, previously constructed by
new
expression and releases the obtained memory area. The expression must result in a pointer value that was returned by previous call to the new
expression. For single allocated objects the first version of the expression must be used, whereas for arrays the second version must be used. There is no delete expression deallocating objects initialized by placement new, deallocation function and destructor must be explicitly called.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.
メモリはメモリ解放関数、どちらoperator delete(表現の最初のバージョンの場合)またはoperator delete[](式の2番目のバージョンの場合)で解放され.
Original:
The memory is deallocated by an メモリ解放関数, either operator delete (for the first version of the expression) or operator delete[] (for the second version of the expression).
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.
メモリ解放関数の名前はまずローカルクラスタイプスコープで検索され、検索が失敗した場合にのみ、グローバルな名前空間が検索されます。
::
はdelete
式中に存在する場合、唯一のグローバルな名前空間が検索されます。関数のプロトタイプは次のようになっている必要がありますOriginal:
The deallocation function's name is firstly looked up in the local class type scope and only if the lookup fails, the global namespace is looked up. If
::
is present in the delete
expression, only the global namespace is looked up. The prototype of the function must look like the following: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.
voidoperator delete (void*ptr); | for the first version | |
voidoperator delete[](void*ptr); | for the second version | |
両方のこれらの関数は、暗黙的に各翻訳単位で宣言されています。プログラムは、それらを明示的に実装されていない限り、また、暗黙の実装は、デフォルトでは、コンパイラによって提供されています。詳細については、このを参照してください。.
Original:
Both these functions are implicitly declared in each translation unit. Also, implicit implementations are provided by the compiler by default, unless the program has explicitly implemented them. See この for more information.
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.