mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 13:21:04 +08:00
Rework reverse_iterator::operator[] so as not to use the base iterators operator [], which can cause constness problems. Fixes PR17883
llvm-svn: 231375
This commit is contained in:
@@ -575,7 +575,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY reverse_iterator& operator-=(difference_type __n)
|
||||
{current += __n; return *this;}
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const
|
||||
{return current[-__n-1];}
|
||||
{return *(*this + __n);}
|
||||
};
|
||||
|
||||
template <class _Iter1, class _Iter2>
|
||||
|
||||
Reference in New Issue
Block a user