<div class="t-tr-text">オペレーター<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">operator</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div> delete<div class="t-tr-text">、演算子<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">, operator</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div> delete[]
提供: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 <new>
|
||
| void operator delete ( void* ptr ); |
(1) | |
| void operator delete[]( void* ptr ); |
(2) | |
| void operator delete ( void* ptr, const std::nothrow_t& ); |
(3) | |
| void operator delete[]( void* ptr, const std::nothrow_t& ); |
(4) | |
| void operator delete ( void* ptr, void*); |
(5) | |
| void operator delete[]( void* ptr, void* ); |
(6) | |
ストレージは、割り当てを解除します。これらの割り当て機能は、動的なオブジェクトを破壊した後にメモリを解放する式を削除しますによって呼び出されます。.
1) Original:
Deallocates storage. These allocation functions are called by 式を削除します to deallocate memory after destructing dynamic 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.
operator new(size_t)またはoperator new(size_t, std::nothrow_t)への呼び出しによって得られた割り当てを解除するストレージ
2) Original:
Deallocates storage, obtained by a call to operator new(size_t) or operator new(size_t, std::nothrow_t)
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 new[](size_t)またはoperator new[](size_t, std::nothrow_t)への呼び出しによって得られた割り当てを解除するストレージ
3-4) Original:
Deallocates storage, obtained by a call to operator new[](size_t) or operator new[](size_t, std::nothrow_t)
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.
置き換えない限り、1-2)と同じ。それらが呼び出すコンストラクタが例外をスローした場合にこれらのバージョンは、非投げ新しい式によって呼び出されます。.
5-6) Original:
Same as 1-2) unless replaced. These versions are called by non-throwing new-expressions if a constructor they call throws an exception.
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.
何もしません。それらが呼び出すコンストラクタが例外をスローした場合にこれらのバージョンは、配置new式で呼ばれています.
Original:
Do nothing. These versions are called by placement new expressions if a constructor they call throws an exception.
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.
ptrがNULLポインターである場合、すべてのケースでは、メモリ解放関数は何もしません.Original:
In all cases, if
ptr is a null pointer, the deallocation function does nothing.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.
目次 |
[編集] 交換とオーバーロード
バージョン1-4)は暗黙
<new>ヘッダが含まれていない場合でも、各翻訳単位で宣言されています。これらの関数は、交換可能な':同じシグネチャを持つユーザが提供する非メンバ関数は暗黙のバージョンを置き換えます。たかだか1交換は4暗黙解除の関数ごとに設けることができる。また、プログラムは、これらの関数のクラスメンバのバージョンを定義したり、異なるシグネチャ(5-6を除く)交換はできません)で割り当て関数を定義することができます.Original:
The versions 1-4) are implicitly declared in each translation unit even if the
<new> header is not included. These functions are replaceable: a user-provided non-member function with the same signature replaces the implicit version. At most one replacement may be provided for each of the four implicit deallocation functions. Also, program can define class member versions of these functions or define allocation functions with different signatures (except 5-6) are not replaceable).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.
メモリ解放関数は二つの方法で置き換え/オーバーロードすることができます
Original:
The deallocation function can be replaced/overloaded in two ways:
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.
- 'グローバルスコープで':それを呼び出すためには、オーバーロードの割り当て関数のシグネチャが暗黙的に宣言されたデフォルトの解除の関数を除いて、解除の代わりに可視でなければなりません。この割り当て機能は、現在のプログラムで対応するパラメータを指定して、すべての割り当て解除に使用されますOriginal:in the global scope: in order to call it, the signature of the overloaded allocation functions must be visible at the place of deallocation, except for implicitly declared default deallocation functions. This allocation function will be used for all deallocations with corresponding parameters in the current programThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 'ローカルスコープの':オーバーロード
operator deleteはクラスの静的パブリックメンバ関数でなければなりません。このメモリ解放関数は、その特定のクラスの割り当て解除のためにのみ使用されます.Original:in the local scope: the overloadedoperator deletemust be static public member function of the class. This deallocation function will be used only for deallocations of that particular class.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
コンパイル時に、各
delete式はクラススコープ内およびグローバルスコープでその後、まず適切なメモリ解放関数の名前のルックアップします。これは、最初のステップをスキップするように指示できます。 オーバーロードの規則に従って、クラススコープで宣言されているすべて解除の関数は、すべてのグローバル解除の関数を非表示にします。詳細については式を削除しますを参照してください.Original:
During compilation, each
delete expression looks up for appropriate deallocation function's name firstly in the class scope and after that in the global scope. It can be instructed to skip the first step. Note, that as per オーバーロードの規則, any deallocation functions declared in class scope hides all global deallocation functions. For more information see 式を削除します.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.
[編集] パラメータ
| ptr | - | 解放するメモリ領域またはNULLポインタへのポインタ
Original: pointer to a memory area to deallocate 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.
[編集] 例外
[編集] も参照してください
[編集] も参照してください
| 割り当て関数 Original: allocation functions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) | |
| 初期化されていないストレージが解放されます Original: releases uninitialized storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) | |
| 割り当てを解除メモリ Original: deallocates memory The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) | |