Some of the Object::equals now are const correct.
There's more to do. Why make this const-correct, instead of ditch it? Because whatever I replace it with has to be ready for const correctness.
This commit is contained in:
@ -242,7 +242,7 @@ public:
|
||||
List(bool ownerOfObjects);
|
||||
~List();
|
||||
|
||||
bool equals(Object *other);
|
||||
bool equals(const Object *other) const override;
|
||||
int hashValue();
|
||||
|
||||
int size ();
|
||||
@ -451,8 +451,8 @@ public:
|
||||
Collection () { this->base = NULL; }
|
||||
~Collection () { if (this->base) delete this->base; }
|
||||
|
||||
bool equals(Object *other)
|
||||
{ return this->base->equals (((Collection<T>*)other)->base); }
|
||||
bool equals(const Object *other) const override
|
||||
{ return this->base->equals (((const Collection<T>*)other)->base); }
|
||||
|
||||
int hashValue() { return this->base->hashValue (); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user