No std::owstream_iterator?
Hi all,
we all know that to print something to std::cout we can use :
1 2
|
std::vector<std::string> cont;
std::copy(cont.begin(), cont.end(), std::ostream_iterator<std::string>(std::cout, " "));
| |
What is the equivalent of this with std::wstring?
1 2
|
std::vector<std::wstring> cont;
std::copy(cont.begin(), cont.end(), std::ostream_iterator<std::wstring> (std::wcout, L"\n")); //<-- obviously doesn't work
| |
There is no such thing as std::wostream_iterator.
Is there maybe a base class or something??
1 2
|
std::vector<std::wstring> cont;
std::copy(cont.begin(), cont.end(), std::ostream_iterator<std::wstring, wchar_t> (std::wcout, L"\n"));
| |
Last edited on
Thanks for reply. I thought that std::wstring was taking care of wchar_t :o
Topic archived. No new replies allowed.