作者samuelduan ()
看板EE_DSnP
標題[問題] 關於 lecture#4 的更正
時間Sat Nov 18 10:50:00 2006
map<string, int> scores;
pair<map<string, int>::iterator, bool> p
= scores.insert(
make_pair(“John”, 100));
上面的是更正的版本
而我之前查了一些資料
有人寫成
map<string, int> scores;
pair<map<string, int>::iterator, bool> p
= scores.insert(
pair(“John”, 100));
或是
map<string, int> scores;
pair<map<string, int>::iterator, bool> p
= scores.insert(
map<string, int>::value_type(“John”, 100));
不知道上面幾種寫法有什麼不一樣呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.109.223.18