I've got a list of elements stored in stl c++ list. How to remove only one of repeating values?
#include <list>
int main() {
std::list<int> listOfInts({ 1, 2, 3, 3, 4, 5 });
listOfInts.remove(3);
return 0;
}
My list will now look like this: 1, 2, 4, 5. Is there a way to make it look like this: 1, 2, 3, 4, 5?
I know it might be very easy, but it's my first time with stl list and I appreciate all tips.