std::moneypunct<CharT,International>::~moneypunct
来自 cppreference.cn
< cpp | locale | moneypunct
定义于头文件 <locale> |
||
protected: ~moneypunct(); |
||
析构一个 std::moneypunct facet。此析构函数是受保护的且为虚函数(由于 基类 析构函数为虚函数)。std::moneypunct 类型的对象,与大多数 facet 一样,只能在实现此 facet 的最后一个 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 }