Re: Is there something basic that I have missed on the upgrade to VS2005?
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Mon, 9 Jan 2006 08:23:02 -0500
"Andy" <arb70sok@xxxxxxxxxxx> wrote in message
news:eEOBd3RFGHA.3176@xxxxxxxxxxxxxxxxxxxx
> I have quite a bit of legacy code that initialises stl containers
> from c arrays thus ...
>
> const char* test_data[] = { "test01", "test02", "test03", "test04",
> "test05" };
> typedef std::vector<std::string> vec_strings;
>
> vec_strings v1(test_data, test_data +
> sizeof(test_data)/sizeof(test_data[0]));
>
> If you cut/paste this code into a new project it will compile, build
> and run just fine.
>
> However there are a number of projects that I have upgraded from
> VS2003.Net. These projects compile/build just fine, but when container
> ctor is
> called I get a debug assertion in the stl code "ITERATOR LIST
> CORRUPTED!"
> This is the code from xutility that is asserting (*_Pnext == 0) and I
> have not a clue why.
I don't think your initialization method causes the problem. You are
doing something illegal elsewhere, like using an iterator after it has
been invalidated (e.g. by modifying the underlying container).
STL shipped with VC8 catches such errors in debug build. VC7.1 does not
have this debugging mode, and you could get away with some violations.
The code is still buggy even if it appears to work, of course.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- References:
- Prev by Date: Is there something basic that I have missed on the upgrade to VS2005?
- Next by Date: Re: Is there something basic that I have missed on the upgrade to VS2005?
- Previous by thread: Is there something basic that I have missed on the upgrade to VS2005?
- Next by thread: Re: Is there something basic that I have missed on the upgrade to VS2005?
- Index(es):
Relevant Pages
|