| 54 | } |
| 55 | |
| 56 | T pop_front() { |
| 57 | if (sz == 0) { |
| 58 | throw std::runtime_error("ring buffer is empty"); |
| 59 | } |
| 60 | T value = data[first]; |
| 61 | first = (first + 1) % capacity; |
| 62 | sz--; |
| 63 | return value; |
| 64 | } |
| 65 | |
| 66 | const T & rat(size_t i) const { |
| 67 | if (i >= sz) { |
no outgoing calls
no test coverage detected