my code is:
class Room {
public:
    int id;
    string name;
    int ownerFd;
    Room(int id, string name, int ownerFd)
    {
        this->id = id;
        this->name = name;
        this->ownerFd = ownerFd;
    }
};
void RemoveUserRooms(int ownerFd) {
    for(auto& room : rooms) {
        if (room.ownerFd == ownerFd) {
            //remove room from list
        }
    }
}
What I want to do is to remove object from list. I already tried with remove and erase but that seems not to work in this way. Is is possible to do with list? 
 
    