例子:
typedef boost::unordered_map<int, int> UserOnlineMap;
UserOnlineMap userOnlineMap_;
std::pair<UserOnlineMap::iterator, bool> res = userOnlineMap_insert(std::make_pair(xxx, xxx));
if (!res.second)
{
std::cout << "insert failed" <<std::endl;
userOnlineMap_[xxx] = xxx;
}
C++ map插入(insert)数据返回值,布布扣,bubuko.com
原文:http://www.cnblogs.com/wuchunming/p/3794012.html