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