Make comparison operators const.

This commit is contained in:
Kuba Sunderland-Ober 2023-06-20 16:35:03 -04:00 committed by Ian McInerney
parent 5b4ddaba89
commit b60f7d4136
4 changed files with 5 additions and 5 deletions

View File

@ -29,7 +29,7 @@
#include <tool/selection.h>
bool SELECTION::operator==( const SELECTION& aOther )
bool SELECTION::operator==( const SELECTION& aOther ) const
{
return ( m_items == aOther.m_items
&& m_itemsOrders == aOther.m_itemsOrders

View File

@ -92,8 +92,8 @@ public:
T operator*() { return static_cast<T>( val ); }
ENUM_ITERATOR begin() { return *this; }
ENUM_ITERATOR end() { return ENUM_ITERATOR( endVal ); }
bool operator==( const ENUM_ITERATOR& aIt ) { return val == aIt.val; }
bool operator!=( const ENUM_ITERATOR& aIt ) { return val != aIt.val; }
bool operator==( const ENUM_ITERATOR& aIt ) const { return val == aIt.val; }
bool operator!=( const ENUM_ITERATOR& aIt ) const { return val != aIt.val; }
};
#endif /* ENUM_VECTOR_H */

View File

@ -65,7 +65,7 @@ public:
return *this;
}
bool operator==( const SELECTION& aOther );
bool operator==( const SELECTION& aOther ) const;
using ITER = std::deque<EDA_ITEM*>::iterator;
using CITER = std::deque<EDA_ITEM*>::const_iterator;

View File

@ -110,7 +110,7 @@ public:
{
}
bool operator==( const DRILL_LINE_ITEM& other )
bool operator==( const DRILL_LINE_ITEM& other ) const
{
return xSize == other.xSize && ySize == other.ySize && shape == other.shape
&& isPlated == other.isPlated && isPad == other.isPad