forked from OSchip/llvm-project
Allow operator-> to work from a FixedStreamArrayIterator.
This is similar to my recent fix for VarStreamArrayIterator, but the cause (and thus the fix) is subtley different. The FixedStreamArrayIterator iterates over a const Array, so the iterator's value type must be const. llvm-svn: 302257
This commit is contained in:
parent
fc481e5eb7
commit
60afb4386d
|
@ -342,7 +342,7 @@ private:
|
|||
template <typename T>
|
||||
class FixedStreamArrayIterator
|
||||
: public iterator_facade_base<FixedStreamArrayIterator<T>,
|
||||
std::random_access_iterator_tag, T> {
|
||||
std::random_access_iterator_tag, const T> {
|
||||
|
||||
public:
|
||||
FixedStreamArrayIterator(const FixedStreamArray<T> &Array, uint32_t Index)
|
||||
|
@ -356,6 +356,7 @@ public:
|
|||
}
|
||||
|
||||
const T &operator*() const { return Array[Index]; }
|
||||
const T &operator*() { return Array[Index]; }
|
||||
|
||||
bool operator==(const FixedStreamArrayIterator<T> &R) const {
|
||||
assert(Array == R.Array);
|
||||
|
|
Loading…
Reference in New Issue