Namensräume
Varianten
Aktionen

std::wbuffer_convert::~wbuffer_convert

Aus cppreference.com

 
 
Lokalisierungen Bibliothek
Locales und Facetten
Original:
Locales and facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale
Buchstaben-Klassifikation
Original:
Character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Conversions
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Facet Kategorie Basisklassen
Original:
Facet category base classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Facet Kategorien
Original:
Facet categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Locale-spezifische Facetten
Original:
Locale-specific facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Code-Konvertierung Facetten
Original:
Code conversion facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
codecvt_utf8(C++11)
codecvt_utf16(C++11)
C locale
Original:
C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
std::wbuffer_convert
Member-Funktionen
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
wbuffer_convert::wbuffer_convert
wbuffer_convert::~wbuffer_convert
wbuffer_convert::rdbuf
wbuffer_convert::state
 
Defined in header <locale>
~wbuffer_convert();
Zerstört die wbuffer_convert Objekt und löscht den Zeiger auf der Umwandlung Facette .
Original:
Destroys the wbuffer_convert object and deletes the pointer to the conversion facet.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Notes

Einige Implementierungen sind in der Lage, jede Facette, einschließlich der locale-spezifischen Facetten mit geschützten Destruktoren löschen. Andere Implementierungen erfordern die Facette eines öffentlichen destructor, ähnlich wie die der locale-unabhängige Facetten <codecvt> haben .
Original:
Some implementations are able to delete any facet, including the locale-specific facets with protected destructors. Other implementations require the facet to have a public destructor, similar to the the locale-independent facets from <codecvt>.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Beispiel

#include <locale>
#include <utility>
#include <iostream>
#include <codecvt>
 
// utility wrapper to adapt locale-bound facets for wstring/wbuffer convert
template<class Facet>
struct deletable_facet : Facet
{
    template<class ...Args>
    deletable_facet(Args&& ...args) : Facet(std::forward<Args>(args)...) {}
    ~deletable_facet() {}
};
 
int main()
{
    // GB18030 / UCS4 conversion, using locale-based facet directly
    // typedef std::codecvt_byname<char32_t, char, std::mbstate_t> gbfacet_t;
    // Compiler error: "calling a protected destructor of codecvt_byname<> in ~wbuffer_convert"
    // std::wbuffer_convert<gbfacet_t, char32_t> gbto32(std::cout.rdbuf(),
    //                                        new gbfacet_t("zh_CN.gb18030"));
 
    // GB18030 / UCS4 conversion facet using a facet with public destructor
    typedef deletable_facet<std::codecvt_byname<char32_t, char, std::mbstate_t>> gbfacet_t;
    std::wbuffer_convert<gbfacet_t, char32_t> gbto32(std::cout.rdbuf(),
                                           new gbfacet_t("zh_CN.gb18030"));
} // destructor called here


[Bearbeiten] Siehe auch

zerstört sich die wstring_convert und seine Umwandlung Facette
Original:
destructs the wstring_convert and its conversion facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(öffentliche Elementfunktion of std::wstring_convert) [edit]