名稱空間
變體
操作

std::codecvt<InternT,ExternT,StateT>::~codecvt

來自 cppreference.com
< cpp‎ | locale‎ | codecvt
 
 
 
 
 
定義於標頭檔案 <locale>
protected: ~codecvt();

銷燬一個 std::codecvt 面(facet)。此解構函式是受保護的虛擬函式(因為其基類解構函式是虛擬函式)。一個 std::codecvt 型別的物件,像大多數面一樣,只能在最後一個實現此面的 std::locale 物件超出作用域時銷燬,或者當用戶定義的類派生自 std::codecvt 並實現公共解構函式時銷燬。

[編輯] 示例

#include <iostream>
#include <locale>
 
struct Destructible_codecvt : public std::codecvt<wchar_t, char, std::mbstate_t>
{
    Destructible_codecvt(std::size_t refs = 0) : codecvt(refs) {}
    // note: the implicit destructor is public
};
 
int main()
{
    Destructible_codecvt dc;
    // std::codecvt<wchar_t> c; // compile error: protected destructor
}