jeudi 25 avril 2019

How to fix error "vector iterators in range are from different containers" in c++?

I don't know where is the problem. The program crashes in this function. Can you help me?

void atrinkimas_2(vector <duomenys>& studentai, vector<duomenys> &silpni)
{
    sort(studentai.begin(), studentai.end(), tikrinimas_gal);
    std::vector<duomenys>::iterator it = std::find_if(studentai.begin(), studentai.end(), tikrinimas_5);
    std::copy(it, studentai.end(), std::back_inserter(silpni));
    studentai.resize(studentai.size() - silpni.size());
}

Aucun commentaire:

Enregistrer un commentaire