Skip to content

Commit

Permalink
STYLE: Remove (void *) casts from implementation AutoPointer comparisons
Browse files Browse the repository at this point in the history
Following C++ Core Guidelines, Oct 3, 2024, "Avoid casts",
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es48-avoid-casts
  • Loading branch information
N-Dekker committed Dec 18, 2024
1 parent c9b342e commit 41f5bbc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Modules/Core/Common/include/itkAutoPointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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. */
Expand Down

0 comments on commit 41f5bbc

Please sign in to comment.