命名空间
变体
操作

std::money_put<CharT,OutputIt>::~money_put

来自 cppreference.cn
< cpp‎ | locale‎ | money put
 
 
 
 
 
定义于头文件 <locale>
protected: ~money_put();

析构一个 std::money_put facet。此析构函数为受保护且虚函数 (因为 基类 析构函数为虚函数)。std::money_put 类型的对象,如同大多数 facets,仅能在实现此 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
}