名稱空間
變體
操作

std::moneypunct<CharT,International>::~moneypunct

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

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

[編輯] 示例

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