RoundBuf

Cyclic buffer, see https://en.wikipedia.org/wiki/Circular_buffer Bails out if you try to push beyond its size

Note the RoundBuf has copy semantics. So if you pass in a Struct it will copy its contents.

Constructors

this
this(size_t n)

initializes round buffer of size n

Members

Functions

back
auto ref back()

Returns the tail item (non-destructive)

empty
bool empty()

Input range primitives

front
auto ref front()

Get the item at the front (non-destructive)

full
bool full()

Check if buffer is full

length
size_t length()

Current number of elements

max_length
size_t max_length()
Undocumented in source. Be warned that the author may not have intended to support it.
popFront
void popFront()

Move the front forward (destructive)

put
void put(T item)

Add and item at the tail and move pointer forward (destructive)

Meta