命名空间
变体
操作

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

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

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

[编辑] 示例

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