Just for clarification, I'm referring to the global getline() function in the string class.
What I want to do is to have something like this:
int main()
{
wifstream in(L"textfile.txt");
someFunc(in);
return 0;
}
void someFunc(const wistream& read)
{
wstring buff;
while(getline(read, buff))
{
//do some processing here
}
}
but I'm getting a:
Error 2 error C2664: 'std::getline' : cannot convert parameter 1 from 'const std::wistream' to 'std::basic_istream<_Elem,_Traits> &'
In order to fix it, I need to remove the const from const wistream& read. I understand why this is happening but is it possible to configure getline() to accept a wistream instead without any conversions or should I just ignore it and remove the const?