You cannot use this method in your example. This method is based on the fact that the input is free space. In your question, you say your lines are a ; separated as "the;quick;brown;fox" . For this you can use std:getline with ';' as a delimiter to break a string.
std::wstring str = L"the;quick;brown;fox", temp; std::vector<std::wstring> parts; std::wstringstream wss(str); while(std::getline(wss, temp, L';')) parts.push_back(temp);
The above loads the string into the stream, and then will call std::getline when split into ';' until it reaches the end of the stream.
I would also like to point out that if your second example shared data that you would not see in it
copy(List.begin(), List.end(), ostream_iterator<wstring>(cout, ";"));
Put ';' straight to the line. It also requires std::wcout instead of std::cout , since you are dealing with wide characters.
According to cppreference, ctype has two different specializations for char and wchar_t and they have different functions. You cannot just change all ctype<char> events to ctype<wchar_t> and run as ctype<wchar_t> no functions that the second example uses
source share