BAN: Vector::const_iterator now uses const T* as underlying type

This commit is contained in:
Bananymous 2023-02-09 23:06:49 +02:00
parent bfc9a2377c
commit e5ffc1686f
1 changed files with 3 additions and 2 deletions

View File

@ -81,6 +81,7 @@ namespace BAN
{ {
public: public:
using value_type = T; using value_type = T;
using data_type = maybe_const_t<CONST, T>;
public: public:
VectorIterator() = default; VectorIterator() = default;
@ -107,10 +108,10 @@ namespace BAN
bool operator!=(const VectorIterator<T, CONST>& other) const { return !(*this == other); } bool operator!=(const VectorIterator<T, CONST>& other) const { return !(*this == other); }
private: private:
VectorIterator(T* data) : m_data(data) { } VectorIterator(data_type* data) : m_data(data) { }
private: private:
T* m_data = nullptr; data_type* m_data = nullptr;
friend class Vector<T>; friend class Vector<T>;
friend class VectorIterator<T, !CONST>; friend class VectorIterator<T, !CONST>;