Add a fixed buffer

This commit is contained in:
Victor Zverovich
2020-07-10 06:30:37 -07:00
parent 60c43e8703
commit 36406509d9
2 changed files with 17 additions and 7 deletions

View File

@@ -372,8 +372,10 @@ reserve(std::back_insert_iterator<Container> it, size_t n) {
}
template <typename T>
inline checked_ptr<T> reserve(buffer_appender<T> it, size_t n) {
return reserve(std::back_insert_iterator<buffer<T>>(it), n);
inline buffer_appender<T> reserve(buffer_appender<T> it, size_t n) {
buffer<T>& buf = get_container(it);
buf.reserve(buf.size() + n);
return it;
}
template <typename Iterator> inline Iterator& reserve(Iterator& it, size_t) {