mirror of
https://github.com/megawac/RingBuffer.nim.git
synced 2026-01-02 07:24:39 +00:00
No description
| docs | ||
| test | ||
| .gitignore | ||
| .travis.yml | ||
| Readme.md | ||
| RingBuffer.nim | ||
| RingBuffer.nimble | ||
Nim implementation of Circular buffers 
A circular buffer, cyclic buffer or ring buffer is a data structure that uses a single, fixed-size buffer as if it were connected end-to-end. This structure lends itself easily to buffering data streams.
Usage
var b = newRingBuffer[int](5)
b.add([1, 2, 3, 4, 5])
b.add(6)
b.add([7, 8])
@b == [4, 5, 6, 7, 8]
