I have a map like this:
map<prmNode,vector<prmEdge> > nodo2archi;
In a certain situation, I have to change an object's attribute in a value into the vector of prmEdge. This is the code:
prmNode par=freePathNode[z];
z++;
prmNode arr=freePathNode[z];
map<prmNode,vector<prmEdge> >::iterator it;
it=nodo2archi.find(par);
app.clear();
vector<prmEdge> arc;
arc=(*it).second;
app=arc;
vector<prmEdge>::iterator itarc;
for (itarc=app.begin(); itarc!=app.end(); itarc++){
prmEdge arco=(*itarc);
int a=arco.getFrom();
int b=arco.getTo();
int f=par.getIndex();
int t=arr.getIndex();
if ((a==f && b==t) || (b==f && a==t)){
if (arco.getState()==0){
if (!is_free_arco(par,arr)){
togli_arco_par(arco,arr);
erased = true;
return erased;
}
else{
//ERROR
//it->second(it->second.begin()).setState(1);
//(*it).second.begin().setState(1);
}
}
}
}
I have to use the method setState to change an attribute into the map. The problem is that I don't have any method from map to make this operation, and in this way i have a compilation error. Could anybody give me an help to solve this?? Thank you very much!