Skip to content

Commit ca0021b

Browse files
N-Dekkerdzenanz
authored andcommitted
STYLE: Default default-constructor ImageConstIteratorWithIndex/OnlyIndex
Defaulted the default-constructors of ImageConstIteratorWithIndex and ImageConstIteratorWithOnlyIndex. Added in-class default member initializers to their data members.
1 parent e877347 commit ca0021b

File tree

4 files changed

+13
-34
lines changed

4 files changed

+13
-34
lines changed

Modules/Core/Common/include/itkImageConstIteratorWithIndex.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithIndex
138138

139139
/** Default Constructor. Need to provide a default constructor since we
140140
* provide a copy constructor. */
141-
ImageConstIteratorWithIndex();
141+
ImageConstIteratorWithIndex() = default;
142142

143143
/** Copy Constructor. The copy constructor is provided to make sure the
144144
* handle to the image is properly reference counted. */
@@ -285,26 +285,26 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithIndex
285285
}
286286

287287
protected: // made protected so other iterators can access
288-
typename TImage::ConstWeakPointer m_Image;
288+
typename TImage::ConstWeakPointer m_Image{};
289289

290290
IndexType m_PositionIndex{ { 0 } }; // Index where we currently are
291291
IndexType m_BeginIndex{ { 0 } }; // Index to start iterating over
292292
IndexType m_EndIndex{ { 0 } }; // Index to finish iterating:
293293
// one pixel past the end of each
294294
// row, col, slice, etc....
295295

296-
RegionType m_Region; // region to iterate over
296+
RegionType m_Region{}; // region to iterate over
297297

298298
OffsetValueType m_OffsetTable[ImageDimension + 1]{};
299299

300-
const InternalPixelType * m_Position;
301-
const InternalPixelType * m_Begin;
302-
const InternalPixelType * m_End;
300+
const InternalPixelType * m_Position{ nullptr };
301+
const InternalPixelType * m_Begin{ nullptr };
302+
const InternalPixelType * m_End{ nullptr };
303303

304-
bool m_Remaining;
304+
bool m_Remaining{ false };
305305

306-
AccessorType m_PixelAccessor;
307-
AccessorFunctorType m_PixelAccessorFunctor;
306+
AccessorType m_PixelAccessor{};
307+
AccessorFunctorType m_PixelAccessorFunctor{};
308308
};
309309
} // end namespace itk
310310

Modules/Core/Common/include/itkImageConstIteratorWithIndex.hxx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@
2121

2222
namespace itk
2323
{
24-
//----------------------------------------------------------------------
25-
// Constructor
26-
//----------------------------------------------------------------------
27-
template <typename TImage>
28-
ImageConstIteratorWithIndex<TImage>::ImageConstIteratorWithIndex()
29-
{
30-
m_Position = nullptr;
31-
m_Begin = nullptr;
32-
m_End = nullptr;
33-
m_Remaining = false;
34-
}
35-
3624
//----------------------------------------------------------------------
3725
// Constructor
3826
//----------------------------------------------------------------------

Modules/Core/Common/include/itkImageConstIteratorWithOnlyIndex.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithOnlyIndex
124124

125125
/** Default Constructor. Need to provide a default constructor since we
126126
* provide a copy constructor. */
127-
ImageConstIteratorWithOnlyIndex();
127+
ImageConstIteratorWithOnlyIndex() = default;
128128

129129
/** Copy Constructor. The copy constructor is provided to make sure the
130130
* handle to the image is properly reference counted. */
@@ -254,19 +254,19 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithOnlyIndex
254254
}
255255

256256
protected: // made protected so other iterators can access
257-
typename TImage::ConstPointer m_Image;
257+
typename TImage::ConstPointer m_Image{};
258258

259259
IndexType m_PositionIndex{ { 0 } }; // Index where we currently are
260260
IndexType m_BeginIndex{ { 0 } }; // Index to start iterating over
261261
IndexType m_EndIndex{ { 0 } }; // Index to finish iterating:
262262
// one pixel past the end of each
263263
// row, col, slice, etc....
264264

265-
RegionType m_Region; // region to iterate over
265+
RegionType m_Region{}; // region to iterate over
266266

267267
OffsetValueType m_OffsetTable[ImageDimension + 1]{};
268268

269-
bool m_Remaining;
269+
bool m_Remaining{ false };
270270
};
271271
} // end namespace itk
272272

Modules/Core/Common/include/itkImageConstIteratorWithOnlyIndex.hxx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@
2121

2222
namespace itk
2323
{
24-
//----------------------------------------------------------------------
25-
// Constructor
26-
//----------------------------------------------------------------------
27-
template <typename TImage>
28-
ImageConstIteratorWithOnlyIndex<TImage>::ImageConstIteratorWithOnlyIndex()
29-
{
30-
m_Remaining = false;
31-
}
32-
3324
//----------------------------------------------------------------------
3425
// Constructor
3526
//----------------------------------------------------------------------

0 commit comments

Comments
 (0)