std::num_get<CharT,InputIt>::~num_get
Определён в заголовочном файле <locale> | ||
|---|---|---|
protected: ~num_get(); |
Уничтожает фасет std::num_get. Этот деструктор защищён и виртуален (поскольку деструктор базового класса является виртуальным). Объект типа std::num_get, как и большинство фасетов, можно уничтожить только тогда, когда последний объект 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
}
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/locale/num_get/~num_get