Skip to content

Commit

Permalink
STYLE: Default default-constructor ImageConstIteratorWithIndex/OnlyIndex
Browse files Browse the repository at this point in the history
Defaulted the default-constructors of ImageConstIteratorWithIndex and
ImageConstIteratorWithOnlyIndex. Added in-class default member initializers to
their data members.
  • Loading branch information
N-Dekker authored and dzenanz committed Jan 27, 2023
1 parent e877347 commit ca0021b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 34 deletions.
18 changes: 9 additions & 9 deletions Modules/Core/Common/include/itkImageConstIteratorWithIndex.h
Expand Up @@ -138,7 +138,7 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithIndex

/** Default Constructor. Need to provide a default constructor since we
* provide a copy constructor. */
ImageConstIteratorWithIndex();
ImageConstIteratorWithIndex() = default;

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

protected: // made protected so other iterators can access
typename TImage::ConstWeakPointer m_Image;
typename TImage::ConstWeakPointer m_Image{};

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

RegionType m_Region; // region to iterate over
RegionType m_Region{}; // region to iterate over

OffsetValueType m_OffsetTable[ImageDimension + 1]{};

const InternalPixelType * m_Position;
const InternalPixelType * m_Begin;
const InternalPixelType * m_End;
const InternalPixelType * m_Position{ nullptr };
const InternalPixelType * m_Begin{ nullptr };
const InternalPixelType * m_End{ nullptr };

bool m_Remaining;
bool m_Remaining{ false };

AccessorType m_PixelAccessor;
AccessorFunctorType m_PixelAccessorFunctor;
AccessorType m_PixelAccessor{};
AccessorFunctorType m_PixelAccessorFunctor{};
};
} // end namespace itk

Expand Down
12 changes: 0 additions & 12 deletions Modules/Core/Common/include/itkImageConstIteratorWithIndex.hxx
Expand Up @@ -21,18 +21,6 @@

namespace itk
{
//----------------------------------------------------------------------
// Constructor
//----------------------------------------------------------------------
template <typename TImage>
ImageConstIteratorWithIndex<TImage>::ImageConstIteratorWithIndex()
{
m_Position = nullptr;
m_Begin = nullptr;
m_End = nullptr;
m_Remaining = false;
}

//----------------------------------------------------------------------
// Constructor
//----------------------------------------------------------------------
Expand Down
Expand Up @@ -124,7 +124,7 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithOnlyIndex

/** Default Constructor. Need to provide a default constructor since we
* provide a copy constructor. */
ImageConstIteratorWithOnlyIndex();
ImageConstIteratorWithOnlyIndex() = default;

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

protected: // made protected so other iterators can access
typename TImage::ConstPointer m_Image;
typename TImage::ConstPointer m_Image{};

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

RegionType m_Region; // region to iterate over
RegionType m_Region{}; // region to iterate over

OffsetValueType m_OffsetTable[ImageDimension + 1]{};

bool m_Remaining;
bool m_Remaining{ false };
};
} // end namespace itk

Expand Down
Expand Up @@ -21,15 +21,6 @@

namespace itk
{
//----------------------------------------------------------------------
// Constructor
//----------------------------------------------------------------------
template <typename TImage>
ImageConstIteratorWithOnlyIndex<TImage>::ImageConstIteratorWithOnlyIndex()
{
m_Remaining = false;
}

//----------------------------------------------------------------------
// Constructor
//----------------------------------------------------------------------
Expand Down

0 comments on commit ca0021b

Please sign in to comment.