zoneserver.cpp:5186: error: no match for ‘operator=’ in ‘itr = ((ZoneServer*)this)->ZoneServer::m_timedActions.std::map<_Key, _Tp, _Compare, _Alloc>::erase [with _Key = TimedAction*, _Tp = unsigned int, _Compare = std::less<TimedAction*>, _Alloc = std::allocator<std::pair<TimedAction* const, unsigned int> >](itr)’
/usr/include/c++/4.4/bits/stl_tree.h:154: note: candidates are: std::_Rb_tree_iterator<std::pair<TimedAction* const,
unsigned int> >& std::_Rb_tree_iterator<std::pair<TimedAction* const, unsigned int> >::operator=(const std::_Rb_tree_iterator<std::pair<TimedAction* const, unsigned int> >&)
Rev 2323, linux compile fails
Moderator: Team Members
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Rev 2323, linux compile fails
Again, Windows is being forgiving where Linux is not.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Rev 2323, linux compile fails
iterator doesn't have a '=' operator??? I swear I have used erase like this before without issue, will look into this.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Rev 2323, linux compile fails
added #include <map> to zoneserver.cpp, hopefully that will fix the issue.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: Rev 2323, linux compile fails
Actually nm that won't change anything as the header file already had that, going to revert that change.Jabantiz wrote:added #include <map> to zoneserver.cpp, hopefully that will fix the issue.
And I think I found the actual problem, erase will return an iterator (the way I am using it) in c++ 11, earlier version return a void.
http://www.cplusplus.com/reference/map/map/erase/
so it depends what version of c++ your compiler uses.
Not sure how to handle this now...
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Rev 2323, linux compile fails
Scat says he's on it, since it's a linux issue I asked him to look into it.Jabantiz wrote:Not sure how to handle this now...
Stand by, Jab.
Edit: From Scat -
Make sense?give the code on svn a try. basically you need 2 iterators. when you find an element you need to delete, you set the delete iterator to the looping iterator, then increment the looping iterator, then delete from the map where the delete iterator itr.
old code: itr = map.erase(itr);
new code: itr_delete = itr++; map.erase(itr_delete);
Who is online
Users browsing this forum: No registered users and 0 guests