#pragma once #include #include namespace chatterino { namespace messages { template class LimitedQueueSnapshot { public: LimitedQueueSnapshot(std::shared_ptr> vector, int offset, int size) : _vector(vector) , _offset(offset) , _length(size) { } int getSize() { return _length; } T const &operator[](int index) const { return _vector->at(index + _offset); } private: std::shared_ptr> _vector; int _offset; int _length; }; } // namespace messages } // namespace chatterino