用迭代器遍历map
struct TaskInfo ...
std::map<int, TaskInfo*> maps;
//正确遍历:
std::map<int, TaskInfo*>::iterator iter;
for (iter=maps.begin(); iter!=maps.end(); iter++)
{
GH_LOG_INFO("%d, %s", iter->first, iter->second);
}
网友评论