Merge pull request #6769

b641e0a2c Add clear method to byte_stream (Lee Clagett)
This commit is contained in:
Alexander Blair 2020-08-27 12:05:15 -07:00
commit 44cd8a13ec
No known key found for this signature in database
GPG key ID: C64552D877C32479
2 changed files with 44 additions and 0 deletions

View file

@ -117,6 +117,9 @@ namespace epee
check(more);
}
//! Reset write position, but do not release internal memory. \post `size() == 0`.
void clear() noexcept { next_write_ = buffer_.get(); }
/*! Copy `length` bytes starting at `ptr` to end of stream.
\throw std::range_error If exceeding max size_t value.
\throw std::bad_alloc If allocation fails. */