命名空间
变体
操作

std::moneypunct<CharT,International>::~moneypunct

来自 cppreference.cn
 
 
 
 
 
定义于头文件 <locale>
protected: ~moneypunct();

销毁 std::moneypunct 构面。此析构函数是受保护且虚拟的(因为基类析构函数是虚拟的)。std::moneypunct 类型的对象,与大多数构面一样,只能在实现此构面的最后一个 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
}