テスト中の次のデータがあります。
2011-01-03 2116
2011-01-03 2120
2011-01-04 2116
2011-01-04 2115
および次のコード:
std::map<std::string, std::vector<double> >::iterator tk = test.begin();
std::vector<double>tmp;
std::copy(tk->second.begin(), tk->second.end(), std::back_inserter(tmp));
上記のコードtmp
には以下が含まれます。
2116
2120
2116
2115
tk->second
ただし、各日付の平均を に挿入したいと思いtmp
ます。back_inserter をループに書き込む必要がありますか?