|
-
August 5th, 2010, 12:18 PM
#9
Re: [RESOLVED] std::set<int> can't find negative value
Pretty silly in the end, but here it goes.
I set a breakpoint in my code where the collection was being searched for -111. At the time I only had positive values in the collection, one of which was 111. So I used the data menu (the one that pops up when you mouse over a variable), to change the value in the collection from 111 to -111. When that failed, I thought something wonky was going on, so I posted about it here. If I had taken more time to realize that the collection was sorted, then I would have realized that you can't change a value on the fly like that and expect the Find() method to work correctly. When I added the value the proper way with Insert(-111), then the Find(-111) worked as expected.
Definitely not the sexy iterator manipulation you were probably thinking of
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|