If I have a STL list that contains pointers to a class and want to access a class member how would I go about that? Specifically, I need to be able to delete members of the list which each have a member with a unique id.
So I have something like:
class Actor{
private:
int id;
public:
int getActorID(){ return id;};
};
std::list<Actor *> actorList;
std::list<Actor *>::iterator i;
So if each actor has a unique id, how could I remove the actor with a specific ID? I've been using a linked list that was hand coded but I want to switch it to STL. Only problem is I can't figure out how to access the method getActorID() to find the node to remove. Thanks for any help.