std::wbuffer_convert::~wbuffer_convert
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <locale>
|
||
~wbuffer_convert(); |
||
Distrugge l'oggetto wbuffer_convert ed elimina il puntatore alla faccetta di conversione.
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.
You can help to correct and verify the translation. Click here for instructions.
Note
Alcune implementazioni sono in grado di eliminare qualsiasi aspetto, comprese le specifiche delle impostazioni locali sfaccettature con distruttori protette. Altre implementazioni richiedono l'aspetto di avere un distruttore pubblica, simile a quello delle impostazioni locali indipendenti sfaccettature da
<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.
You can help to correct and verify the translation. Click here for instructions.
Esempio
#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
Vedi anche
distrugge la wstring_convert e il suo aspetto di conversione 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. (metodo pubblico) | |