From f60dc98cef6bddfef1552b02d9622f3333c4730b Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Sat, 25 Mar 2023 19:13:07 +0100 Subject: [PATCH] COMP: Declare `operator<(const SliceIterator &)` member function const The original code erroneously disallowed evaluating the expression `lhs < rhs` when `lhs` would be a `const` reference to a SliceIterator. --- Modules/Core/Common/include/itkSliceIterator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Core/Common/include/itkSliceIterator.h b/Modules/Core/Common/include/itkSliceIterator.h index 3f3962a09c3..13ab52ff284 100644 --- a/Modules/Core/Common/include/itkSliceIterator.h +++ b/Modules/Core/Common/include/itkSliceIterator.h @@ -116,7 +116,7 @@ class SliceIterator * is only true if the slice iterators have the same stride and * start location. */ bool - operator<(const SliceIterator & orig) + operator<(const SliceIterator & orig) const { return this->m_Pos < orig.m_Pos && this->m_Slice.stride() == orig.m_Slice.stride() && this->m_Slice.start() == orig.m_Slice.start();