| 97 | } |
| 98 | |
| 99 | std::vector<T> to_vector() const { |
| 100 | std::vector<T> result; |
| 101 | result.reserve(sz); |
| 102 | for (size_t i = 0; i < sz; i++) { |
| 103 | result.push_back(data[(first + i) % capacity]); |
| 104 | } |
| 105 | return result; |
| 106 | } |
| 107 | |
| 108 | void clear() { |
| 109 | // here only reset the status of the buffer |