Skip to content

Commit

Permalink
Fix compile error when using std::sort with Visual Studio 16.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Mar 18, 2020
1 parent d32e0b9 commit d19527c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utility/tarray.h
Expand Up @@ -94,6 +94,10 @@ template<typename T> class TIterator : public std::iterator<std::random_access_i
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; }
Expand Down

0 comments on commit d19527c

Please sign in to comment.