@@ -146,52 +146,50 @@ class ImageRegionRange final
146
146
{}
147
147
148
148
template <size_t VIndex>
149
- void Increment (std::true_type) noexcept
149
+ void
150
+ Increment () noexcept
150
151
{
151
- static_assert (VIndex < (ImageDimension - 1 ), " For a larger index value, the other overload should be picked" );
152
-
153
152
m_BufferIterator += m_OffsetTable[VIndex];
154
153
155
- if ( static_cast <SizeValueType>(++m_IterationOffset[VIndex]) >= m_IterationRegionSize[VIndex] )
154
+ if constexpr (VIndex < (ImageDimension - 1 ) )
156
155
{
157
- m_IterationOffset[VIndex] = 0 ;
158
- m_BufferIterator -= m_OffsetTable[VIndex] * m_IterationRegionSize[VIndex];
159
- this ->Increment <VIndex + 1 >(std::integral_constant<bool , (VIndex + 1 ) < (ImageDimension - 1 )>{});
156
+ if (static_cast <SizeValueType>(++m_IterationOffset[VIndex]) >= m_IterationRegionSize[VIndex])
157
+ {
158
+ m_IterationOffset[VIndex] = 0 ;
159
+ m_BufferIterator -= m_OffsetTable[VIndex] * m_IterationRegionSize[VIndex];
160
+ this ->Increment <VIndex + 1 >();
161
+ }
160
162
}
161
- }
162
-
163
- template <size_t VIndex>
164
- void Increment (std::false_type) noexcept
165
- {
166
- static_assert (VIndex == (ImageDimension - 1 ), " For a smaller index value, the other overload should be picked" );
163
+ else
164
+ {
165
+ static_assert (VIndex == (ImageDimension - 1 ));
167
166
168
- ++m_IterationOffset[VIndex];
169
- m_BufferIterator += m_OffsetTable[VIndex];
167
+ ++m_IterationOffset[VIndex];
168
+ }
170
169
}
171
170
172
171
173
172
template <size_t VIndex>
174
- void Decrement (std::true_type) noexcept
173
+ void
174
+ Decrement () noexcept
175
175
{
176
- static_assert (VIndex < (ImageDimension - 1 ), " For a larger index value, the other overload should be picked" );
177
-
178
176
m_BufferIterator -= m_OffsetTable[VIndex];
179
177
180
- if (--m_IterationOffset[ VIndex] < 0 )
178
+ if constexpr ( VIndex < (ImageDimension - 1 ) )
181
179
{
182
- m_IterationOffset[VIndex] = m_IterationRegionSize[VIndex] - 1 ;
183
- m_BufferIterator += m_OffsetTable[VIndex] * m_IterationRegionSize[VIndex];
184
- this ->Decrement <VIndex + 1 >(std::integral_constant<bool , (VIndex + 1 ) < (ImageDimension - 1 )>{});
180
+ if (--m_IterationOffset[VIndex] < 0 )
181
+ {
182
+ m_IterationOffset[VIndex] = m_IterationRegionSize[VIndex] - 1 ;
183
+ m_BufferIterator += m_OffsetTable[VIndex] * m_IterationRegionSize[VIndex];
184
+ this ->Decrement <VIndex + 1 >();
185
+ }
185
186
}
186
- }
187
-
188
- template <size_t VIndex>
189
- void Decrement (std::false_type) noexcept
190
- {
191
- static_assert (VIndex == (ImageDimension - 1 ), " For a smaller index value, the other overload should be picked" );
187
+ else
188
+ {
189
+ static_assert (VIndex == (ImageDimension - 1 ));
192
190
193
- --m_IterationOffset[VIndex];
194
- m_BufferIterator -= m_OffsetTable[VIndex];
191
+ --m_IterationOffset[VIndex];
192
+ }
195
193
}
196
194
197
195
@@ -230,7 +228,7 @@ class ImageRegionRange final
230
228
QualifiedIterator &
231
229
operator ++() noexcept
232
230
{
233
- this ->Increment <0 >(std::integral_constant< bool , (ImageDimension > 1 )>{} );
231
+ this ->Increment <0 >();
234
232
return *this ;
235
233
}
236
234
@@ -250,7 +248,7 @@ class ImageRegionRange final
250
248
QualifiedIterator &
251
249
operator --() noexcept
252
250
{
253
- this ->Decrement <0 >(std::integral_constant< bool , (ImageDimension > 1 )>{} );
251
+ this ->Decrement <0 >();
254
252
return *this ;
255
253
}
256
254
0 commit comments