名稱空間
變體
操作

std::time_get<CharT,InputIt>::~time_get

來自 cppreference.com
< cpp‎ | 本地化‎ | time_get
 
 
 
 
 
定義於標頭檔案 <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
}