by 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.