Added clear() to basic_buffer

This commit is contained in:
gabime 2018-07-09 14:47:22 +03:00 committed by Victor Zverovich
parent 60c662b3a7
commit e5c93108e6

View File

@ -379,6 +379,11 @@ class basic_buffer {
size_ = new_size; size_ = new_size;
} }
/** Clears this buffer. */
void clear() {
size_ = 0;
}
/** Reserves space to store at least *capacity* elements. */ /** Reserves space to store at least *capacity* elements. */
void reserve(std::size_t new_capacity) { void reserve(std::size_t new_capacity) {
if (new_capacity > capacity_) if (new_capacity > capacity_)