| 61 | } |
| 62 | |
| 63 | T pop_front() { |
| 64 | if (sz == 0) { |
| 65 | throw std::runtime_error("ring buffer is empty"); |
| 66 | } |
| 67 | T value = data[first]; |
| 68 | first = (first + 1) % capacity; |
| 69 | sz--; |
| 70 | return value; |
| 71 | } |
| 72 | |
| 73 | const T & rat(size_t i) const { |
| 74 | if (i >= sz) { |
no outgoing calls
no test coverage detected