Closed bmerry closed 11 months ago
Previously, the canonical way to iterate over all the received heaps in a ring_stream was:
while (true) { try { auto heap = stream.pop(); // Do stuff with heap } catch (spead2::ringbuffer_stopped &) { break; } }
With this change, it's possible to rewrite that as
for (auto &&heap : stream) { // Do stuff with heap }
@sjperkins thanks for the review. A slight improvement occurred to me in the meantime, which I've just pushed. Could you take a look? It's just a couple of lines.
Previously, the canonical way to iterate over all the received heaps in a ring_stream was:
With this change, it's possible to rewrite that as