Hello, I can't figure out how to remove elements from a list of structures up to a certain one, my code looks like this:
int i = 0;
studentasL paskutinis;
for (auto it = Prad.begin(); it != Prad.end(); ++it)
{
if ((*it).rez_vid >= 5) { paskutinis = (*it); break; }
else {vargsiukai.push_back(*it);}
}
Prad.erase(Prad.begin(), paskutinis);
It goes through a sorted list of structures until it finds the first one with the variable rez_vid <5. Then I need to assign every element from the list up to there to a new list, and every one above that to another, while also maintaining time efficiency