地圖我不明白這是什麼一段代碼確實插入到輸入C++
static TwoWayHostPair hostpair;
map <TwoWayHostPair, Traffic> mymap;
//here some map element inserted to mymap and hostpair initialized
map <TwoWayHostPair, Traffic>::iterator iter = mymap.begin();
iter = mymap.find(hostpair);
if (iter == mymap.end()) {
iter = mymap.insert(make_pair(hostPair, Traffic())).first; //line8
}
我的問題是在line8會發生什麼?我沒有得到它。它不應該是map<...>:iterator
類型,並在此插入後它保持相同的類型?
謝謝,讚賞 – smttsp