![]() |
| | #1 |
| Registered User Join Date: Mar 2009
Posts: 35
| no match for operator = Code: while (iter != dcFacMap.end())
{
FacilityId facId = iter->first->GetFacilityId();
vector<FacilityId>::iterator facIter = find(oFacIdList.begin(),
oFacIdList.end(), facId);
if (facIter == oFacIdList.end())
{
//DC has no outbound
iter = dcFacMap.erase(iter);
}
else
{
iter++;
}
}
FleetRouteGenManager.cpp:5774: error: no match for âoperator=â in âiter = ((SequencedFacilityMap*)dcFacMap)->std::map<_Key, _Tp, _Compare, _Alloc>::erase [with _Key = Facility*, _Tp = std::vector<Facility*, std::allocator<Facility*> >, _Compare = std::less<Facility*>, _Alloc = std::allocator<std::pair<Facility* const, std::vector<Facility*, std::allocator<Facility*> > > >](iter)â /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tree.h:152: note: candidates are: std::_Rb_tree_iterator<std::pair<Facility* const, std::vector<Facility*, std::allocator<Facility*> > > >& std::_Rb_tree_iterator<std::pair<Facility* const, std::vector<Facility*, std::allocator<Facility*> > > >::operator=(const std::_Rb_tree_iterator<std::pair<Facility* const, std::vector<Facility*, std::allocator<Facility*> > > >&) Last edited by vaibhavs17; 03-30-2009 at 06:19 AM. |
| vaibhavs17 is offline | |
| | #2 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| So you haven't got an iterator copy constructor. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #3 |
| Registered User Join Date: Mar 2009
Posts: 35
| I could not understand, please explain. |
| vaibhavs17 is offline | |
| | #4 | |
| The larch Join Date: May 2006
Posts: 3,082
| map::erase might not return an iterator, although this can vary between implementations
__________________ I might be wrong. Quote:
Last edited by anon; 03-30-2009 at 11:12 AM. | |
| anon is offline | |
| | #5 |
| Algorithm Dissector Join Date: Dec 2005 Location: New Zealand
Posts: 2,476
| Nah he's got the copy-constructor, otherwise the line with the find would fail to compile. That line is doing assignment anyway. Probably missing the assignment operator.
__________________ My homepage Advice: Take only as directed - If symptoms persist, please see your debugger |
| iMalc is offline | |
![]() |
| Tags |
| code |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| getting error while building the same on linux "no match for operator" | vaibhavs17 | C++ Programming | 9 | 03-30-2009 06:37 PM |
| no match for 'operator>>' | Taka | C++ Programming | 3 | 03-30-2009 12:17 AM |
| No Match For Operator+ ??????? | Paul22000 | C++ Programming | 24 | 05-14-2008 10:53 AM |
| 2 array match | ajastru2000 | C++ Programming | 5 | 07-18-2003 07:58 AM |
| How do I match 2 files to print data. | sketchit | A Brief History of Cprogramming.com | 0 | 11-12-2001 05:45 PM |