Hello, I'm currently working on some code based around the use of lists. Im currently trying to compare two lists and delete any elements in list "a" if they already exists in list "b". Im struggling right now, 2am here so I'm really tired, but I'm generating an error that says something like "can't find next value" below is my code
After OpenList.erase(opIt);, opIt is invalid, and --opIt; as well as ++opIt; are errors.
To delete the elements from one list that satisfy some condition (e.g. exist in another), consider remove-erase instead of loops. If you want to do it by hand, use the value that OpenList.erase(opIt); returns, it's there for a reason.