我正在尝试这个:
std::wstringstream wstrStream;
std::wifstream wifStream(str.c_str());
wifStream >> wstrStream;
但我得到了这个编译错误:
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>
]
我了解运算符 >> 未针对 wchar_t 实现。
我发现很少有文档和对 std::wifstream 的引用。你将如何使用它?