std::numpunct<CharT>::~numpunct
來自 cppreference.com
< cpp | locale(本地化) | numpunct
定義於標頭檔案 <locale> |
||
protected: ~numpunct(); |
||
銷燬 std::numpunct facet。此解構函式是受保護且虛的(因為基類解構函式是虛的)。一個 std::numpunct 型別的物件,與大多數 facet 一樣,只能在實現此 facet 的最後一個 std::locale 物件超出作用域時銷燬,或者當用戶定義的類從 std::numpunct 派生並實現一個公有解構函式時銷燬。
[編輯] 示例
執行此程式碼
#include <iostream> #include <locale> struct Destructible_numpunct : public std::numpunct<wchar_t> { Destructible_numpunct(std::size_t refs = 0) : numpunct(refs) {} // note: the implicit destructor is public }; int main() { Destructible_numpunct dc; // std::numpunct<wchar_t> c; // compile error: protected destructor }