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