From d19527cf87d1caa58a23ae2b9b6d1e9030c989a5 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Wed, 18 Mar 2020 21:11:44 +0100 Subject: [PATCH] Fix compile error when using std::sort with Visual Studio 16.5.0 --- src/utility/tarray.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utility/tarray.h b/src/utility/tarray.h index ca4d86bc7..32ccc50ce 100644 --- a/src/utility/tarray.h +++ b/src/utility/tarray.h @@ -94,6 +94,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; }