8 std::vector<T> stream_;
11 : size_(size), pos_(0), stream_(size, init) {}
12 void lshift () { pos_ = (pos_ + 1) % size_; }
13 void rshift () { pos_ = pos_ > 0 ? pos_ - 1 : size_ - 1; }
14 const T & read () {
return stream_[pos_]; }
15 void write (
const T & t) { stream_[pos_] = t; }