Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>What are the arguments for and against to support std::wstring only?</p> </blockquote> <p>The argument in favor of using wide characters is that it can do everything narrow characters can and more. </p> <p>The argument against it that I know are: </p> <ul> <li>wide characters need more space (which is hardly relevant, the Chinese do not, in principle, have more headaches over memory than Americans have)</li> <li>using wide characters gives headaches to some westerners who are used for all their characters to fit into 7bit (and are unwilling to learn to pay a bit of attention to not to intermingle uses of the character type for actual characters vs. other uses)</li> </ul> <p>As for being flexible: I have maintained a library (several kLoC) that could deal with both narrow and wide characters. Most of it was through the character type being a template parameter, I don't remember any macros (other than <code>UNICODE</code>, that is). Not all of it was flexible, though, there was some code in there which ultimately required either <code>char</code> or <code>wchar_t</code> string. (No point in making internal key strings wide using wide characters.)<br> Users could decide whether they wanted only narrow character support (in which case <code>"string"</code> was fine) or only wide character support (which required them to use <code>L"string"</code>) or whether they wanted to support both, too (which required something like <code>T("string")</code>). </p>
 

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