wstring ss;
ss << L"Some wide-char text" << " and some non-wide-char text";
This appears to work just fine but why, when char_type is not char?
wstring ss;
ss << L"Some wide-char text" << " and some non-wide-char text";
This appears to work just fine but why, when char_type is not char?
All streams have overloads for char, regardless of the CharT of the template.
http://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt2
template< class CharT, class Traits >
basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os,
const char* s );
Because it is.
Exactly
std::char_traits<char>::length(s)characters are inserted.
Before insertion, first, all characters are widened usingos.widen().
(source)