-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
istreambuf_iterator constructed with istream at eof isn't detected #149
Comments
This might be related to #28. |
[istreambuf.iterator.ops] para 5 & 6:
Yet this program: #include <cassert>
#include <iterator>
#include <sstream>
int main()
{
auto in = std::istringstream{};
assert(in.rdbuf() != nullptr);
using I = std::istreambuf_iterator<char>;
// Since in.rdbuf() != nullptr, I{in} does not construct an end-of-stream iterator. Right?
assert(I{in} != I{});
} Fails on on libstdc++/libc++/STLSTL. |
When comparing a freshly-constructed
istreambuf_iterator
with anistream
that has already reached EOF,istreambuf_iterator != default_sentinel
returnstrue
. This behaviour differs fromstd::istreambuf_iterator
.Interestingly, this is only on the first pass: commenting out line 12 causes the program to complete without error.
The text was updated successfully, but these errors were encountered: