isn't this enough to check whether the map contains i...Code:it2=mymap.find(i); if(it2!=mymap.end()) { }
It doesn't work for me...
Am i wrong?
If yes ,wat shud be the snippet
isn't this enough to check whether the map contains i...Code:it2=mymap.find(i); if(it2!=mymap.end()) { }
It doesn't work for me...
Am i wrong?
If yes ,wat shud be the snippet
Last edited by dpp; 06-25-2009 at 11:46 PM.
And what is the type of i? Does it implement ordering correctly?
I might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
That's the correct way to check if an item is in the map. If it's "not working" then either you are mistaken about the item being/not being present, or the type of the object you are storing in the map does not correctly implement a partial ordering.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}