How to find & remove object from a std::list ?
I'm trying to find an object in an std::list of objects, and remove it and I was going to look for the NAME of the object as a basis of comparison, something like this:
Question is, how do I lok for just the NAME using the find command?
//then later in the code....
itr = find(myList.begin(),myList.end(), /*look for myObj name */ );
if (itr != myList.end())
itr = myList.erase(itr);
Thanks for the help! :)