Espacios de nombres
Variantes

std::wbuffer_convert::~wbuffer_convert

De cppreference.com
 
 
 
std::wbuffer_convert
Las funciones miembro
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.
 
Definido en el archivo de encabezado <locale>
~wbuffer_convert();
Destruye el objeto wbuffer_convert y elimina el puntero a la conversión faceta .
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.

Notas

Algunas implementaciones son capaces de borrar cualquier faceta, incluyendo los aspectos específicos de la localidad con destructores protegidas. Otras implementaciones requieren la faceta a tener un destructor público, similar a las de los independientes de la configuración regional facetas de <codecvt> .
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.

Ejemplo

#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


Ver también

destruye la wstring_convert y su faceta de conversión
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.

(función miembro pública de std::wstring_convert) [editar]