Spec-Zone.ru › C++

std::num_put<CharT,OutputIt>::~num_put

Определено в заголовке <locale>
protected: ~num_put();

Удаляет объект типа std::num_put фацет. Этот деструктор защищён и виртуальный (из-за виртуального деструктора базового класса базовый класс). Объект типа std::num_put, как и большинство фацетов, может быть удалён только тогда, когда последний объект std::locale, реализующий этот фацет, выходит из области видимости или если пользовательский класс унаследован от std::num_put и реализует публичный деструктор.

Пример

#include <iostream>
#include <locale>
 
struct Destructible_num_put : public std::num_put<wchar_t>
{
    Destructible_num_put(std::size_t refs = 0) : num_put(refs) {}
    // note: the implicit destructor is public
};
 
int main()
{
    Destructible_num_put dc;
    // std::num_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/num_put/%7Enum_put

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API