| 78 | } |
| 79 | |
| 80 | std::vector<T> to_vector() const { |
| 81 | std::vector<T> result; |
| 82 | result.reserve(sz); |
| 83 | for (size_t i = 0; i < sz; i++) { |
| 84 | result.push_back(data[(first + i) % capacity]); |
| 85 | } |
| 86 | return result; |
| 87 | } |
| 88 | |
| 89 | void clear() { |
| 90 | // here only reset the status of the buffer |