You must use wstring, wchar_t
as the template parameters, and wcout
as the output stream:
std::copy(v.begin(),
v.end(),
std::ostream_iterator<std::wstring, wchar_t>(std::wcout, L"\n"));
Test program:
#include <vector>
#include <string>
#include <iostream>
#include <iterator>
int main () {
std::vector<std::wstring> v;
v.push_back(L"Hello");
v.push_back(L"World");
std::copy(v.begin(),
v.end(),
std::ostream_iterator<std::wstring, wchar_t>(std::wcout, L"\n"));
}