From b923f9612bc65aef6ac74c44c6ce86a0e7b87087 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 21 Mar 2020 11:18:04 +0200 Subject: [PATCH] - fixed compilation with MSVC 16.5.0 when using std::sort() with TArray<> error C2676: binary '[': 'TIterator' does not define this operator or a conversion to a type acceptable to the predefined operator --- source/common/utility/tarray.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/common/utility/tarray.h b/source/common/utility/tarray.h index 0f6e081e3..97515f13f 100644 --- a/source/common/utility/tarray.h +++ b/source/common/utility/tarray.h @@ -78,6 +78,10 @@ public: TIterator operator-(difference_type offset) const { return TIterator(m_ptr - offset); } difference_type operator-(const TIterator &other) const { return m_ptr - other.m_ptr; } + // Random access operators + T& operator[](difference_type i) { return m_ptr[i]; } + const T& operator[](difference_type i) const { return m_ptr[i]; } + T &operator*() { return *m_ptr; } const T &operator*() const { return *m_ptr; } T* operator->() { return m_ptr; }