How to chain delete pairs from a vector in C++?
问题 I have this text file where I am reading each line into a std::vector<std::pair> , handgun bullets bullets ore bombs ore turret bullets The first item depends on the second item. And I am writing a delete function where, when the user inputs an item name, it deletes the pair containing the item as second item. Since there is a dependency relationship, the item depending on the deleted item should also be deleted since it is no longer usable. For example, if I delete ore , bullets and bombs