more reliable and accurate empty() checking in StreamRange
parent
41c0ac0fdd
commit
b4146b0523
|
@ -68,7 +68,7 @@ struct StreamRange<T, true>: InputRange<
|
||||||
StreamRange(const StreamRange &r): p_stream(r.p_stream), p_size(r.p_size) {}
|
StreamRange(const StreamRange &r): p_stream(r.p_stream), p_size(r.p_size) {}
|
||||||
|
|
||||||
bool empty() const {
|
bool empty() const {
|
||||||
return p_stream->tell() == p_size;
|
return (p_size - p_stream->tell()) < StreamOffset(sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pop_front() {
|
bool pop_front() {
|
||||||
|
|
Loading…
Reference in New Issue