From 00ead18cd1cd03983681a0f37da420f7f5fe7a76 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Sun, 1 Mar 2026 22:59:34 +0100 Subject: [PATCH] COMP: Let NthElementPixelAccessor follow the Rule of Zero Removed its user-declared defaulted default-constructor and assignment operator, in order to address C++20 warnings, saying (on Linux/GCC 11.4.0): warning: implicitly-declared 'constexpr NthElementPixelAccessor::NthElementPixelAccessor(const NthElementPixelAccessor&)' is deprecated [-Wdeprecated-copy] --- .../ImageAdaptors/include/itkNthElementPixelAccessor.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h b/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h index 72024be289e..45152e230c7 100644 --- a/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h +++ b/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h @@ -42,6 +42,9 @@ namespace itk * For performance, no bound checking is performed during * access to the n-th element. * + * \note NthElementPixelAccessor does not have any user-declared "special member function", + * following the C++ Rule of Zero: the compiler will generate them if necessary. + * * \sa ImageAdaptor * \sa PixelAccessor * @@ -101,13 +104,6 @@ class NthElementPixelAccessor ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Self); - /** Assignment operator */ - NthElementPixelAccessor & - operator=(const NthElementPixelAccessor & accessor) = default; - - /** Constructor */ - NthElementPixelAccessor() = default; - private: // Identifier of the N-th element to be accessed unsigned int m_ElementNumber{ 0 };