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:
Lynix 2015-01-07 19:19:53 +01:00
parent 72a24c4d7c
commit 6c4f8e7396
2 changed files with 14 additions and 0 deletions

View File

@ -46,7 +46,9 @@ class NzSparsePtr
T& operator[](int index) const;
NzSparsePtr operator+(int count) const;
NzSparsePtr operator+(unsigned int count) const;
NzSparsePtr operator-(int count) const;
NzSparsePtr operator-(unsigned int count) const;
std::ptrdiff_t operator-(const NzSparsePtr& ptr) const;
NzSparsePtr& operator+=(int count);

View File

@ -127,12 +127,24 @@ NzSparsePtr<T> NzSparsePtr<T>::operator+(int count) const
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>
NzSparsePtr<T> NzSparsePtr<T>::operator-(int count) const
{
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>
std::ptrdiff_t NzSparsePtr<T>::operator-(const NzSparsePtr& ptr) const
{