bool Memory::getline(string &line)
{
+ if(pos==end)
+ {
+ set_eof();
+ return false;
+ }
+
char *nl = find(pos, end, '\n');
line.assign(pos, nl);
- bool result = (nl!=pos);
- pos = nl;
- return result;
+ pos = (nl==end ? end : nl+1);
+ return true;
}
int Memory::get()