Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>1) <code>char16_t</code> and <code>char32_t</code> will be distinct new types, so overloading on them will be possible.</p> <p>Quote from <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2018.html" rel="noreferrer">ISO/IEC JTC1 SC22 WG21 N2018</a>:</p> <blockquote> <p>Define <code>char16_t</code> to be a typedef to a distinct new type, with the name <code>_Char16_t</code> that has the same size and representation as <code>uint_least16_t</code>. Likewise, define <code>char32_t</code> to be a typedef to a distinct new type, with the name <code>_Char32_t</code> that has the same size and representation as <code>uint_least32_t</code>.</p> </blockquote> <p>Further explanation (from a devx.com article "<a href="http://www.devx.com/cplus/10MinuteSolution/34328/1954" rel="noreferrer">Prepare Yourself for the Unicode Revolution</a>"):</p> <blockquote> <p>You're probably wondering why the <code>_Char16_t</code> and <code>_Char32_t</code> types and keywords are needed in the first place when the typedefs <code>uint_least16_t</code> and <code>uint_least32_t</code> are already available. The main problem that the new types solve is overloading. It's now possible to overload functions that take <code>_Char16_t</code> and <code>_Char32_t</code> arguments, and create specializations such as <code>std::basic_string&lt;_Char16_t&gt;</code> that are distinct from <code>std::basic_string &lt;wchar_t&gt;</code>.</p> </blockquote> <p>2) <code>u16string</code> and <code>u32string</code> are indeed part of C++0x and not just GCC'isms, as they are mentioned in <a href="http://www.google.com/search?q=u16string+site%3Aopen-std.org" rel="noreferrer">various standard draft papers</a>. They will be included in the new <code>&lt;string&gt;</code> header. Quote from the same article:</p> <blockquote> <p>The Standard Library will also provide <code>_Char16_t</code> and <code>_Char32_t</code> typedefs, in analogy to the typedefs <code>wstring</code>, <code>wcout</code>, etc., for the following standard classes:</p> <p><code>filebuf, streambuf, streampos, streamoff, ios, istream, ostream, fstream, ifstream, ofstream, stringstream, istringstream, ostringstream,</code> <strong><code>string</code></strong></p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload