Commit 4a529cd6 authored by Philipp Nordhus's avatar Philipp Nordhus

Return reference on iterator indirection/subscript

parent e3844e0f
......@@ -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);
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment