从 windows 到 linux(3):std::list::erase 不能用 const_iterator

来源:互联网 发布:网页下载软件 编辑:程序博客网 时间:2024/06/04 19:14
../src/map_server/Team/RandomTeamManager.cpp: In member function ‘void RandomTeamManager::_HandleConfirmTeam(uint32, bool)’:../src/map_server/Team/RandomTeamManager.cpp:138: error: no matching function for call to ‘std::list<RandomQueueEntry, std::allocator<RandomQueueEntry> >::erase(std::_List_const_iterator<RandomQueueEntry>&)’/usr/include/c++/4.4/bits/list.tcc:107: note: candidates are: std::_List_iterator<_Tp> std::list<_Tp, _Alloc>::erase(std::_List_iterator<_Tp>) [with _Tp = RandomQueueEntry, _Alloc = std::allocator<RandomQueueEntry>]/usr/include/c++/4.4/bits/stl_list.h:1092: note:                 std::_List_iterator<_Tp> std::list<_Tp, _Alloc>::erase(std::_List_iterator<_Tp>, std::_List_iterator<_Tp>) [with _Tp = RandomQueueEntry, _Alloc = std::allocator<RandomQueueEntry>]
改成使用 iterator 删除,OK
0 0
原创粉丝点击