I was trying to use the set::find and set::erase function for a customized struct type.
To test the situation where it is asked to find and erase a non existing candidate, I used to code below:
this results in empty output with no error. It looks like the code got stuck.
if change line 32 to number numbertofind; numbertofind.id = 3;
The output is:
myset contains: 10 20 40 50
What I want to achieve is to be able to detect that I was trying to find an non existing candidate, and skip it.
It will be surprising if <set> could not do this, but I just could not figure out how.