命名空间
变体
操作

std::money_get<CharT,InputIt>::~money_get

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

析构一个 std::money_get 构面。此析构函数是受保护的和虚函数(因为 基类 析构函数是虚函数)。std::money_get 类型的对象,像大多数构面一样,只能在最后一个实现此构面的 std::locale 对象超出作用域时,或者如果用户定义的类派生自 std::money_get 并实现公共析构函数时销毁。

[编辑] 示例

#include <iostream>
#include <locale>
 
struct Destructible_money_get : public std::money_get<wchar_t>
{
    Destructible_money_get(std::size_t refs = 0) : money_get(refs) {}
    // note: the implicit destructor is public
};
 
int main()
{
    Destructible_money_get dc;
    // std::money_get<wchar_t> c; // compile error: protected destructor
}