C++ map插入(insert)数据返回值
例子:
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;
}