Adding convenience append(range)

This commit is contained in:
Barry Revzin authored and Victor Zverovich committed 2020-08-08 06:33:46 -07:00
1 parent 0e7cef069b
commit d0dd678693
2 files changed
+8 -1

No files matched your search

+7
View File
@@ -685,6 +685,13 @@ class basic_memory_buffer : public detail::buffer<T> {
/** Increases the buffer capacity to *new_capacity*. */
void reserve(size_t new_capacity) { this->try_reserve(new_capacity); }
// Directly append data into the buffer
using detail::buffer<T>::append;
template <typename ContiguousRange>
void append(const ContiguousRange& range) {
append(range.data(), range.data() + range.size());
}
};
template <typename T, size_t SIZE, typename Allocator>