< cpp‎ | locale‎ | time get

定义于头文件 <locale>
protected: ~time_get();
自毁一个std::time_get方面。析构函数被保护和虚拟(由于基类析构函数是虚拟的)。 std::time_get类型的对象,最喜欢的方面,只能被摧毁,当最后std::locale对象,它实现这方面熄灭范围,或者如果一个用户定义的类派生自std::time_get和实现公共析构函数.
Destructs a std::time_get facet. This destructor is protected and virtual (due to 基类 destructor being virtual). An object of type std::time_get, like most facets, can only be destroyed when the last std::locale object that implements this facet goes out of scope or if a user-defined class is derived from std::time_get and implements a public destructor.
这段文字是通过 Google Translate 自动翻译生成的。

[编辑] 为例

#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) {}
    ~Destructible_time_get() {}; // public dtor
int main()
    Destructible_time_get dc;
    // std::time_get<wchar_t> c;  // compile error: protected destructor