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