Return reference on iterator indirection/subscript

This commit is contained in:
Philipp Nordhus 2016-06-11 15:17:52 +02:00
parent e3844e0f26
commit 4a529cd641
2 changed files with 4 additions and 4 deletions

View File

@ -2880,9 +2880,9 @@ public:
//! copy operator
MatConstIterator_& operator = (const MatConstIterator_& it);
//! returns the current matrix element
_Tp operator *() const;
const _Tp& operator *() const;
//! returns the i-th matrix element, relative to the current
_Tp operator [](ptrdiff_t i) const;
const _Tp& operator [](ptrdiff_t i) const;
//! shifts the iterator forward by the specified number of elements
MatConstIterator_& operator += (ptrdiff_t ofs);

View File

@ -2550,7 +2550,7 @@ MatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator = (const MatConstIterat
}
template<typename _Tp> inline
_Tp MatConstIterator_<_Tp>::operator *() const
const _Tp& MatConstIterator_<_Tp>::operator *() const
{
return *(_Tp*)(this->ptr);
}
@ -2656,7 +2656,7 @@ MatConstIterator_<_Tp> operator - (const MatConstIterator_<_Tp>& a, ptrdiff_t of
}
template<typename _Tp> inline
_Tp MatConstIterator_<_Tp>::operator [](ptrdiff_t i) const
const _Tp& MatConstIterator_<_Tp>::operator [](ptrdiff_t i) const
{
return *(_Tp*)MatConstIterator::operator [](i);
}