名稱空間
變體
操作

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

來自 cppreference.com
 
 
 
 
 
定義於標頭檔案 <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
}