std::moneypunct<CharT,International>::~moneypunct
From cppreference.com
< cpp | locale | moneypunct
| ヘッダー <locale> で定義 |
||
| protected: ~moneypunct(); |
||
std::moneypunct ファセットを破棄します。このデストラクタは保護されており、仮想です(基底クラスのデストラクタが仮想であるため)。std::moneypunct 型のオブジェクトは、ほとんどのファセットと同様に、このファセットを実装している最後の std::locale オブジェクトがスコープを外れるか、または std::moneypunct から派生したユーザー定義クラスが公開デストラクタを実装している場合にのみ破棄できます。
[編集] 例
このコードを実行
#include <iostream> #include <locale> struct Destructible_moneypunct : public std::moneypunct<wchar_t> { Destructible_moneypunct(std::size_t refs = 0) : moneypunct(refs) {} // note: the implicit destructor is public }; int main() { Destructible_moneypunct dc; // std::moneypunct<wchar_t> c; // compile error: protected destructor }