#pragma once #include #include #include #include namespace chatterino { template class LimitedQueue; template class LimitedQueueSnapshot { private: friend class LimitedQueue; LimitedQueueSnapshot(const boost::circular_buffer &buf) : buffer_(buf.begin(), buf.end()) { } public: LimitedQueueSnapshot() = default; size_t size() const { return this->buffer_.size(); } const T &operator[](size_t index) const { return this->buffer_[index]; } auto begin() const { return this->buffer_.begin(); } auto end() const { return this->buffer_.end(); } auto rbegin() const { return this->buffer_.rbegin(); } auto rend() const { return this->buffer_.rend(); } private: std::vector buffer_; }; } // namespace chatterino