aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-08-27 12:05:15 -0700
committerAlexander Blair <snipa@jagtech.io>2020-08-27 12:05:16 -0700
commit44cd8a13ec85288aafd86f24a36ec53ac7cd9efa (patch)
treed8ee8db2339c7542cfbf1679c5ea4e7d68979797 /contrib
parentMerge pull request #6739 (diff)
parentAdd clear method to byte_stream (diff)
downloadmonero-44cd8a13ec85288aafd86f24a36ec53ac7cd9efa.tar.xz
Merge pull request #6769
b641e0a2c Add clear method to byte_stream (Lee Clagett)
Diffstat (limited to 'contrib')
-rw-r--r--contrib/epee/include/byte_stream.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/epee/include/byte_stream.h b/contrib/epee/include/byte_stream.h
index 98f563ca9..42a9e1dd9 100644
--- a/contrib/epee/include/byte_stream.h
+++ b/contrib/epee/include/byte_stream.h
@@ -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. */