I am trying this:
std::wstringstream wstrStream;
std::wifstream wifStream(str.c_str());
wifStream >> wstrStream;
but I got this compilation error:
error C2664: 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>
(std::basic_istream<_Elem,_Traits>::_Myt &(__cdecl *)
(std::basic_istream<_Elem,_Traits>::_Myt &))' : cannot convert parameter 1 from
'std::wstringstream' to 'std::basic_istream<_Elem,_Traits>::_Myt &(__cdecl *)
(std::basic_istream<_Elem,_Traits>::_Myt &)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>
]
and
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>
]
I understand that operator >> is not implemented for wchar_t.
I found little documentation and references to std::wifstream. How would you use it ?
std::wstringstream
? Do you meanstd::wstring
? – Confer