Namespaces
Variants

std::time_put<CharT,OutputIt>:: ~time_put

From cppreference.net
定义于头文件 <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) {}
    // 注意:隐式析构函数是公开的
};
int main()
{
    Destructible_time_put dc;
    // std::time_put<wchar_t> c; // 编译错误:受保护的析构函数
}