std::num_put<CharT,OutputIt>::~num_put
来自 cppreference.cn
定义于头文件 <locale> |
||
protected: ~num_put(); |
||
销毁 std::num_put facet。此析构函数是受保护和虚拟的(因为基类析构函数是虚拟的)。std::num_put 类型的对象,像大多数 facet 一样,只能在实现此 facet 的最后一个 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 }