
4 Nov
2015
4 Nov
'15
11:12 p.m.
Mere moments ago, quoth I:
Secondly, note that read_until may (and usually does) read data beyond the delimiter into the buffer. It is therefore essential to preserve this buffer between calls (ie. don't make it a local variable), and to properly mark the bytes that you are extracting from it as consumed so that you don't keep getting the same line again.
To clarify, std::getline does consume the bytes. If you were using some other method to extract data from the streambuf then you might need to do something more explicit.