template<typename T> inline void circular_buffer<T>::shift_left(size_type &index, size_type offset) const { requires(index < this->_capacity); requires(offset <= this->_capacity); if (index >= offset) { ensures((index - offset) < this->_capacity); index -= offset; } else { ensures((index + this->_capacity - offset) < this->_capacity); index += (this->_capacity - offset); } }
template<typename T> inline void circular_buffer<T>::shift_right(size_type &index, size_type offset) const { requires(index < this->_capacity); requires(offset <= this->_capacity); index += offset; if (index >= this->_capacity) { index -= this->_capacity; } ensures(index < this->_capacity); }
void p() { ensures(g == old(g)); g++; }
PositiveNumber(T k) { requires(k > 0); value = k; ensures(value > 0); }