std::time_put<CharT,OutputIt>::~time_put
来自 cppreference.cn
定义于头文件 <locale> |
||
protected: ~time_put(); |
||
析构一个 std::time_put facet。此析构函数是受保护的且为虚函数(因为 基类 析构函数是虚函数)。类型为 std::time_put 的对象,像大多数 facet 一样,只有在实现此 facet 的最后一个 std::locale 对象超出作用域时,或者当用户定义的类派生自 std::time_put 并实现公共析构函数时,才能销毁。
[编辑] 示例
运行此代码
#include <iostream> #include <locale> struct Destructible_time_put : public std::time_put<wchar_t> { Destructible_time_put(std::size_t refs = 0) : time_put(refs) {} // note: the implicit destructor is public }; int main() { Destructible_time_put dc; // std::time_put<wchar_t> c; // compile error: protected destructor }