命名空间
变体
操作

std::numpunct<CharT>::~numpunct

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

销毁 std::numpunct facet。此析构函数是受保护且虚的(因为基类析构函数是虚的)。一个 std::numpunct 类型的对象,与大多数 facet 一样,只能在实现此 facet 的最后一个 std::locale 对象超出作用域时销毁,或者当用户定义的类从 std::numpunct 派生并实现一个公有析构函数时销毁。

[编辑] 示例

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