There is a partial specialization for basic_ostream
template<class _TraitsT>
basic_ostream<char, _TraitsT>&
operator<<(basic_ostream<char, _TraitsT>& _Stream, const char* _String);
which is a good fit for the cout << UserString()
case.
There is nothing similar for wchar_t
and WUserString()
, so the member function
basic_ostream& operator<<(const void* _Address);
will be the best match for that (as in most "unusual" cases).