From 41f5bbc1ee7af321f069537d28d092dc6d2b58f6 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Wed, 18 Dec 2024 20:53:13 +0100 Subject: [PATCH] STYLE: Remove (void *) casts from implementation AutoPointer comparisons Following C++ Core Guidelines, Oct 3, 2024, "Avoid casts", http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es48-avoid-casts --- Modules/Core/Common/include/itkAutoPointer.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Core/Common/include/itkAutoPointer.h b/Modules/Core/Common/include/itkAutoPointer.h index 5eccb9151ce..181ed18e829 100644 --- a/Modules/Core/Common/include/itkAutoPointer.h +++ b/Modules/Core/Common/include/itkAutoPointer.h @@ -160,7 +160,7 @@ class AutoPointer bool operator==(const AutoPointer & r) const { - return (void *)m_Pointer == (void *)r.m_Pointer; + return m_Pointer == r.m_Pointer; } ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Self); @@ -169,28 +169,28 @@ class AutoPointer bool operator<(const AutoPointer & r) const { - return (void *)m_Pointer < (void *)r.m_Pointer; + return m_Pointer < r.m_Pointer; } /** Comparison of pointers. Greater than comparison. */ bool operator>(const AutoPointer & r) const { - return (void *)m_Pointer > (void *)r.m_Pointer; + return m_Pointer > r.m_Pointer; } /** Comparison of pointers. Less than or equal to comparison. */ bool operator<=(const AutoPointer & r) const { - return (void *)m_Pointer <= (void *)r.m_Pointer; + return m_Pointer <= r.m_Pointer; } /** Comparison of pointers. Greater than or equal to comparison. */ bool operator>=(const AutoPointer & r) const { - return (void *)m_Pointer >= (void *)r.m_Pointer; + return m_Pointer >= r.m_Pointer; } /** Overload operator assignment. */