+ 1

Issue on remove

Hi Refer code below: It works if I don't have call to remove Could anyone please help me understand the issue ? https://code.sololearn.com/c34BJ3kzTlsd/?ref=app

3rd Mar 2022, 2:32 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
2 Réponses
+ 1
This is weird. "remove" doesn't remove an element in a specific position, like "erase" do. It will instead remove all elements with the same value. Your objects (Test) doesn't hold any value, nor does it have a equality operator that can be used to check for equality. Try adding an attribute to Test and implement the equality operator.
3rd Mar 2022, 11:28 PM
Mustafa A
Mustafa A - avatar
+ 1
Thanks Mustafa A
4th Mar 2022, 8:39 AM
Ketan Lalcheta
Ketan Lalcheta - avatar