Well I'm heavenly confused right now; When would anyone use a streambuffer over a stream - or otherwise?
Reading cppreference and some online topics regarding this only added to the confusion. To me it seems std::basic_istream
is an "abstraction" of the buffer. So that one should not have to deal with localization etc.
But you still have to do this when reading file data - so what does it actually abstract away?
On the other hand, what does std::basic_streambuf
bring?
And then there's the std::istream_iterator
and std::istreambuf_iterator
. Which both read elements from the "stream". This adds more confusion: is there any difference in above iterators?
PS: using istream
here, but could of course also be ostream
or anything else.
PPS: I should add that confusion was added while googling for examples such as this stackoverflow question