std::time_put<CharT,OutputIt>::~time_put
Определено в заголовочном файле <locale> | ||
|---|---|---|
protected: ~time_put(); |
Удаляет объект std::time_put виджет. Этот деструктор защищён и виртуальный (из-за того, что деструктор базового класса базового класса является виртуальным). Объект типа std::time_put, как и большинство виджетов, может быть удалён только тогда, когда последний объект std::locale, реализующий этот виджет, выходит из области видимости, или если пользовательский класс унаследован от std::time_put и реализует публичный деструктор.
Пример
#include <iostream>
#include <locale>
struct Destructible_time_put : public std::time_put<wchar_t>
{
Destructible_time_put(std::size_t refs = 0) : time_put(refs) {}
// note: the implicit destructor is public
};
int main()
{
Destructible_time_put dc;
// std::time_put<wchar_t> c; // compile error: protected destructor
}
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/locale/time_put/%7Etime_put