std::money_put<CharT,OutputIt>::~money_put
来自 cppreference.cn
定义于头文件 <locale> |
||
protected: ~money_put(); |
||
销毁一个 std::money_put facet。此析构函数是受保护和虚的(因为基类析构函数是虚的)。std::money_put 类型的对象,像大多数 facet 一样,只能在实现此 facet 的最后一个 std::locale 对象超出作用域时销毁,或者如果用户定义的类继承自 std::money_put 并实现了一个公共析构函数。
[编辑] 示例
运行此代码
#include <iostream> #include <locale> struct Destructible_money_put : public std::money_put<wchar_t> { Destructible_money_put(std::size_t refs = 0) : money_put(refs) {} // note: the implicit destructor is public }; int main() { Destructible_money_put dc; // std::money_put<wchar_t> c; // compile error: protected destructor }