Skip to content

Commit

Permalink
ENH: CTAD guide ImageScanlineConstIterator support non-const image
Browse files Browse the repository at this point in the history
Extend the deduction guide of `ImageScanlineConstIterator` to support a
`SmartPointer` argument that represents a non-const image pointer (while
preserving its support for `const` image pointers as argument).
  • Loading branch information
N-Dekker authored and dzenanz committed Apr 24, 2023
1 parent cac4e26 commit a6c3742
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Modules/Core/Common/include/itkImageScanlineConstIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define itkImageScanlineConstIterator_h

#include "itkImageIterator.h"
#include <type_traits> // For remove_const_t.

namespace itk
{
Expand Down Expand Up @@ -263,8 +264,8 @@ class ITK_TEMPLATE_EXPORT ImageScanlineConstIterator : public ImageConstIterator

// Deduction guide for class template argument deduction (CTAD).
template <typename TImage>
ImageScanlineConstIterator(SmartPointer<const TImage>, const typename TImage::RegionType &)
->ImageScanlineConstIterator<TImage>;
ImageScanlineConstIterator(SmartPointer<TImage>, const typename TImage::RegionType &)
->ImageScanlineConstIterator<std::remove_const_t<TImage>>;

} // end namespace itk

Expand Down

0 comments on commit a6c3742

Please sign in to comment.