Add contract to Channel.consumeAll to force the input buffer to be empty.

This commit is contained in:
Sönke Ludwig 2019-01-20 14:31:29 +01:00
parent c21e1aa06d
commit 3503001ec6

View file

@ -84,7 +84,8 @@ struct Channel(T, size_t buffer_size) {
avaiable, `dst` will be left untouched and `false` is returned. avaiable, `dst` will be left untouched and `false` is returned.
*/ */
bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst) bool consumeAll(ref FixedRingBuffer!(T, buffer_size) dst)
{ return m_impl.consumeAll(dst); } in { assert(dst.empty); }
body { return m_impl.consumeAll(dst); }
/** Enqueues an element. /** Enqueues an element.