Bonjour,
j'ai le code suivant :
Qui me sort une erreur comme celle-ci:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 vector < vector < Vertice > > Algorithm::bestInsertion(Vertice &verticeToInsert, vector < vector < Vertice > >&tempSolution) const { vector < vector < Vertice > > bestSolution; double solutionWeight = 0.0; for (unsigned int i=0; i < tempSolution.size(); i++) { for (unsigned int j=0; j <= tempSolution.at(i).size(); j++) { vector < vector < Vertice > > mySolutionCopy = tempSolution; vector<Vertice>::const_iterator it = mySolutionCopy.at(i).begin(); mySolutionCopy.insert(it, verticeToInsert); solutionWeight = getSolutionWeight(mySolutionCopy); printf("poids %f \n",solutionWeight); } } return bestSolution; }
à la ligne du insert()
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 Error 1 error C2664: 'std::_Vector_iterator<_Myvec> std::vector<_Ty>::insert<Vertice&>(std::_Vector_const_iterator<_Myvec>,_Valty)' : cannot convert parameter 1 from 'std::_Vector_const_iterator<_Myvec>' to 'std::_Vector_const_iterator<_Myvec>'
Les deux paramètres de l'erreur sont les même.... je ne vois donc pas comment procéder... qqn a déjà eu ce type de problème?
Merci,
Partager