Moving append to basic_memory_buffer.
This commit is contained in:
parent
b8dc604b96
commit
6d54740295
@ -728,7 +728,6 @@ template <typename T> class buffer {
|
|||||||
|
|
||||||
/** Appends data to the end of the buffer. */
|
/** Appends data to the end of the buffer. */
|
||||||
template <typename U> void append(const U* begin, const U* end);
|
template <typename U> void append(const U* begin, const U* end);
|
||||||
template <typename ContiguousRange> void append(const ContiguousRange&);
|
|
||||||
|
|
||||||
template <typename I> T& operator[](I index) { return ptr_[index]; }
|
template <typename I> T& operator[](I index) { return ptr_[index]; }
|
||||||
template <typename I> const T& operator[](I index) const {
|
template <typename I> const T& operator[](I index) const {
|
||||||
|
|||||||
@ -566,12 +566,6 @@ void buffer<T>::append(const U* begin, const U* end) {
|
|||||||
} while (begin != end);
|
} while (begin != end);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
template <typename ContiguousRange>
|
|
||||||
void buffer<T>::append(const ContiguousRange& range) {
|
|
||||||
append(range.data(), range.data() + range.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename OutputIt, typename T, typename Traits>
|
template <typename OutputIt, typename T, typename Traits>
|
||||||
void iterator_buffer<OutputIt, T, Traits>::flush() {
|
void iterator_buffer<OutputIt, T, Traits>::flush() {
|
||||||
out_ = std::copy_n(data_, this->limit(this->size()), out_);
|
out_ = std::copy_n(data_, this->limit(this->size()), out_);
|
||||||
@ -691,6 +685,13 @@ class basic_memory_buffer : public detail::buffer<T> {
|
|||||||
|
|
||||||
/** Increases the buffer capacity to *new_capacity*. */
|
/** Increases the buffer capacity to *new_capacity*. */
|
||||||
void reserve(size_t new_capacity) { this->try_reserve(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>
|
template <typename T, size_t SIZE, typename Allocator>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user