Fix operator++
This commit is contained in:
parent
971cd54688
commit
ba82a2e066
2 changed files with 15 additions and 3 deletions
|
@ -4,6 +4,7 @@ namespace dk {
|
|||
m_pos(CoordinateScalarType(0)),
|
||||
m_size(parSize)
|
||||
{
|
||||
assert(m_pos <= m_size);
|
||||
}
|
||||
|
||||
template <uint32_t D>
|
||||
|
@ -11,7 +12,7 @@ namespace dk {
|
|||
m_pos(parValue),
|
||||
m_size(parSize)
|
||||
{
|
||||
assert(parValue < parSize);
|
||||
assert(m_pos <= m_size);
|
||||
}
|
||||
|
||||
template <uint32_t D>
|
||||
|
@ -19,7 +20,7 @@ namespace dk {
|
|||
const coords lower(0);
|
||||
for (CoordinateDistType d = 0; d < D - 1; ++d) {
|
||||
++m_pos[d];
|
||||
if (m_pos[d] >= m_size[d])
|
||||
if (m_pos[d] > m_size[d])
|
||||
m_pos[d] = lower[d];
|
||||
else
|
||||
return *this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue