Added SparsePtr::operator[+|-](unsigned int) overload
Let's hope it will be enough to stop GCC from barking at me Former-commit-id: 0bcdf37acdc2e49a4ddd310dcdeb5bd6c66225a1
This commit is contained in:
parent
72a24c4d7c
commit
6c4f8e7396
|
|
@ -46,7 +46,9 @@ class NzSparsePtr
|
||||||
T& operator[](int index) const;
|
T& operator[](int index) const;
|
||||||
|
|
||||||
NzSparsePtr operator+(int count) const;
|
NzSparsePtr operator+(int count) const;
|
||||||
|
NzSparsePtr operator+(unsigned int count) const;
|
||||||
NzSparsePtr operator-(int count) const;
|
NzSparsePtr operator-(int count) const;
|
||||||
|
NzSparsePtr operator-(unsigned int count) const;
|
||||||
std::ptrdiff_t operator-(const NzSparsePtr& ptr) const;
|
std::ptrdiff_t operator-(const NzSparsePtr& ptr) const;
|
||||||
|
|
||||||
NzSparsePtr& operator+=(int count);
|
NzSparsePtr& operator+=(int count);
|
||||||
|
|
|
||||||
|
|
@ -127,12 +127,24 @@ NzSparsePtr<T> NzSparsePtr<T>::operator+(int count) const
|
||||||
return NzSparsePtr(m_ptr + count*m_stride, m_stride);
|
return NzSparsePtr(m_ptr + count*m_stride, m_stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzSparsePtr<T> NzSparsePtr<T>::operator+(unsigned int count) const
|
||||||
|
{
|
||||||
|
return NzSparsePtr(m_ptr + count*m_stride, m_stride);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
NzSparsePtr<T> NzSparsePtr<T>::operator-(int count) const
|
NzSparsePtr<T> NzSparsePtr<T>::operator-(int count) const
|
||||||
{
|
{
|
||||||
return NzSparsePtr(m_ptr - count*m_stride, m_stride);
|
return NzSparsePtr(m_ptr - count*m_stride, m_stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzSparsePtr<T> NzSparsePtr<T>::operator-(unsigned int count) const
|
||||||
|
{
|
||||||
|
return NzSparsePtr(m_ptr - count*m_stride, m_stride);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
std::ptrdiff_t NzSparsePtr<T>::operator-(const NzSparsePtr& ptr) const
|
std::ptrdiff_t NzSparsePtr<T>::operator-(const NzSparsePtr& ptr) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue