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