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