Permalink
Browse files

minor

  • Loading branch information...
janusheide committed Nov 10, 2017
1 parent b85cdd7 commit ff68e00b33c6f77423763b687fc9320f33423bb5
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/endian/stream_reader.hpp
@@ -113,6 +113,7 @@ class stream_reader : public stream
template<uint8_t Bytes, class ValueType>
void peek_bytes(ValueType& value, uint64_t offset=0) const
{
assert(remaining_size() >= offset && "Offset too large");
assert(Bytes <= remaining_size() - offset &&
"Reading over the end of the underlying buffer");
@@ -129,6 +130,7 @@ class stream_reader : public stream
template<class ValueType>
void peek(ValueType& value, uint64_t offset=0) const
{
assert(remaining_size() >= offset && "Offset too large");
assert(sizeof(ValueType) <= remaining_size() - offset &&
"Reading over the end of the underlying buffer");
@@ -143,6 +145,7 @@ class stream_reader : public stream
template<class ValueType>
ValueType peek(uint64_t offset=0) const
{
assert(remaining_size() >= offset && "Offset too large");
assert(sizeof(ValueType) <= remaining_size() - offset &&
"Reading over the end of the underlying buffer");

0 comments on commit ff68e00

Please sign in to comment.