Overview
Features
Download
Documentation
Community
Add-Ons & Services

HashMap will crash in vs2010

Please post support and help requests here.
andycaisc
Posts: 3
Joined: 08 Mar 2012, 10:29

HashMap will crash in vs2010

Postby andycaisc » 08 Mar 2012, 10:45

typedef HashMap<int, int> IntMap;
IntMap hm;
IntMap::Iterator it ;
it = hm.begin(); //---here will make crash in visual studio 2010

Royce
Posts: 19
Joined: 23 Feb 2012, 18:13

Re: HashMap will crash in vs2010

Postby Royce » 05 Jul 2012, 16:04

I get this same thing. On VS2010, HashMAP::begin() causes a null de-reference deep in the call stack, xutility I think, even if the HashMap has elements. It seems like it is associated with operator= for iterators.

That exact same code on VS2003, on the other hand, works just fine. (I don't have 2005 or 2008 or I would try them too).

This was a quite surprise when I upgraded from 2003 to 2010. I had a hard time following the numerous modules (some seemed to be POCO modules and some seemed to be VS2010 modules) that lead up to the null de-reference. I gave up and went with stdext::hash_map in the interests of time. If I had an eye toward cross-platform, I'm sure I'd find that Boost has some sort of hash map as well.

alex
Posts: 1227
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: HashMap will crash in vs2010

Postby alex » 05 Jul 2012, 18:31

I filed a bug report on SF.

Don't know yet what exactly causes this, but we've had to work around the MS standard library implementation bugs before.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 2 guests

cron