std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::~wstring_convert (3) - Linux Manuals
std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::~wstring_convert: std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::~wstring_convert
Command to display std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::~wstring_convert
manual in Linux: $ man 3 std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::~wstring_convert
NAME
std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::~wstring_convert - std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::~wstring_convert
Synopsis
~wstring_convert();
Destroys the wstring_convert object and deletes the pointer to the conversion facet.
Notes
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>. This is LWG_issue_721
Example
// Run this code
#include <locale>
#include <utility>
#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 ~wstring_convert"
// std::wstring_convert<gbfacet_t> gbto32(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::wstring_convert<gbfacet_t> gbto32(new gbfacet_t("zh_CN.gb18030"));
} // destructor called here
Pages related to std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::~wstring_convert
- std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::converted (3) - std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::converted
- std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::from_bytes (3) - std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::from_bytes
- std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::state (3) - std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::state
- std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::to_bytes (3) - std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::to_bytes
- std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::wstring_convert (3) - std::wstring_convert<Codecvt,Elem,Wide_alloc,Byte_alloc>::wstring_convert
- std::wstring_convert (3) - std::wstring_convert
- std::wstring (3) - std::basic_string
- std::wstringbuf (3) - std::basic_stringbuf
- std::wstringstream (3) - std::basic_stringstream
- std::wstringstream::operator= (3) - std::basic_stringstream::operator=
- std::wstringstream::rdbuf (3) - std::basic_stringstream::rdbuf
- std::wstringstream::swap (3) - std::basic_stringstream::swap
- std::wstreambuf (3) - std::basic_streambuf