命名空间
变体
操作

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

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

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

[编辑] 示例

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