C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 03-30-2009, 05:07 AM   #1
Registered User
 
Join Date: Mar 2009
Posts: 35
no match for operator =

I am facing below error at highlighted line

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++;
                }
        }
error:
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   Reply With Quote
Old 03-30-2009, 05:20 AM   #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   Reply With Quote
Old 03-30-2009, 05:52 AM   #3
Registered User
 
Join Date: Mar 2009
Posts: 35
I could not understand, please explain.
vaibhavs17 is offline   Reply With Quote
Old 03-30-2009, 06:17 AM   #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:
Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
Quoted more than 1000 times (I hope).

Last edited by anon; 03-30-2009 at 11:12 AM.
anon is offline   Reply With Quote
Old 03-30-2009, 12:38 PM   #5
Algorithm Dissector
 
iMalc's Avatar
 
Join Date: Dec 2005
Location: New Zealand
Posts: 2,476
Quote:
Originally Posted by matsp View Post
So you haven't got an iterator copy constructor.

--
Mats
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   Reply With Quote
Reply

Tags
code

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 03:56 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22