I have the following code inspired by one of the SO questions:
int main()
{
wcout << "\n\n 1- Test normal string with wcout \n";
wcout << u8"\n 2- Test (u8) string with wcout \n";
wcout << u"\n 3- Test (u) string with wcout \n";
wcout << U"\n 4- Test (U) string with wcout \n";
wcout << L"\n 5- Test (L) string with wcout \n\n";
}
which results in:
cout
has similar output.
I understand from the answer on this post that w/cout does not support the string U/u prefixes, or exactly as mentioned:
Meanwhile
std::cout's
class has no special<<
overload forconst char16_t*
,const char32_t*
andconst wchar_t*
, hence it will match<<
's overload for printing pointers.
My questions are:
1- Why it does not support these types? Isn't it a strange for a language not to support its own types? 2- Are there any known plans to add such support in the seen future?
I know that iostream is a library, but, practically, it is still part of the language.