Spec-Zone.ru › C++

std::money_get<CharT,InputIt>::~money_get

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

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

Пример

#include <iostream>
#include <locale>
 
struct Destructible_money_get : public std::money_get<wchar_t>
{
    Destructible_money_get(std::size_t refs = 0) : money_get(refs) {}
    // note: the implicit destructor is public
};
 
int main()
{
    Destructible_money_get dc;
    // std::money_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/w/cpp/locale/money_get/%7Emoney_get

Spec-Zone.ru

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