#pragma once namespace nall { template struct vector_iterator { vector_iterator(vector& self, uint offset) : self(self), offset(offset) {} auto operator*() -> T& { return self.operator[](offset); } auto operator!=(const vector_iterator& source) const -> bool { return offset != source.offset; } auto operator++() -> vector_iterator& { return offset++, *this; } private: vector& self; uint offset; }; template struct vector_iterator_const { vector_iterator_const(const vector& self, uint offset) : self(self), offset(offset) {} auto operator*() -> const T& { return self.operator[](offset); } auto operator!=(const vector_iterator_const& source) const -> bool { return offset != source.offset; } auto operator++() -> vector_iterator_const& { return offset++, *this; } private: const vector& self; uint offset; }; template struct vector_iterator_reverse { vector_iterator_reverse(vector& self, uint offset) : self(self), offset(offset) {} auto operator*() -> T& { return self.operator[](offset); } auto operator!=(const vector_iterator_reverse& source) const -> bool { return offset != source.offset; } auto operator++() -> vector_iterator_reverse& { return offset--, *this; } private: vector& self; uint offset; }; template struct vector_iterator_reverse_const { vector_iterator_reverse_const(const vector& self, uint offset) : self(self), offset(offset) {} auto operator*() -> const T& { return self.operator[](offset); } auto operator!=(const vector_iterator_reverse_const& source) const -> bool { return offset != source.offset; } auto operator++() -> vector_iterator_reverse_const& { return offset--, *this; } private: const vector& self; uint offset; }; }