「cpp/locale/codecvt/~codecvt」の版間の差分
提供: cppreference.com
TranslationBot (トーク | 投稿記録) (Translated from the English version using Google Translate) |
細 (r2.7.3) (ロボットによる 追加: de, en, es, fr, it, pt, ru, zh) |
||
(1人の利用者による、間の1版が非表示) | |||
1行: | 1行: | ||
{{cpp/locale/facet/destructor|codecvt}} | {{cpp/locale/facet/destructor|codecvt}} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ |
2012年11月2日 (金) 20:44時点における最新版
ヘッダ <locale> で定義
|
||
protected: ~codecvt(); |
||
std::codecvt ファセットを破棄します。 このデストラクタは protected かつ virtual (基底クラスのデストラクタが virtual であるため) です。 std::codecvt 型のオブジェクトは、ほとんどのファセットと同様に、このファセットを実装する最後の std::locale オブジェクトがスコープ外に出たとき、またはユーザ定義クラスが std::codecvt から派生し public なデストラクタを実装する場合にのみ、破棄できます。
[編集] 例
Run this code
#include <iostream> #include <locale> struct Destructible_codecvt : public std::codecvt<wchar_t, char, std::mbstate_t> { Destructible_codecvt(std::size_t refs = 0) : codecvt(refs) {} // note: the implicit destructor is public }; int main() { Destructible_codecvt dc; // std::codecvt<wchar_t> c; // compile error: protected destructor }