Re: Is there something basic that I have missed on the upgrade to VS2005?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"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


.



Relevant Pages

  • Re: Is there something basic that I have missed on the upgrade to VS2005?
    ... >I have quite a bit of legacy code that initialises stl containers from c ... > These projects compile/build just fine, but when container ctor is called ... > I get a debug assertion in the stl code "ITERATOR LIST CORRUPTED!" ...
    (microsoft.public.vc.stl)
  • Is there something basic that I have missed on the upgrade to VS2005?
    ... I have quite a bit of legacy code that initialises stl containers from c ... These projects compile/build just fine, but when container ctor is called I ... get a debug assertion in the stl code "ITERATOR LIST CORRUPTED!" ...
    (microsoft.public.vc.stl)
  • Re: OO Style with Ada Containers
    ... Can you convince me that Ada.Containers is closer to STL than to Java ... But the burden of proof is on you, to prove that the container library ... A generic algorithm in Ada would look something like: ... procedure Generic_Algorithm (C: Cursor); ...
    (comp.lang.ada)
  • Re: VC9: STL: hash_set/map : hash_compare without operator < ???
    ... hash class and for an equal_to class. ... You mean the C++ standard library, not the STL. ... while the other must yield false, provided that the elements are not equal. ... This requires that the container can store multiple ...
    (microsoft.public.vc.language)
  • Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl)
    ... I fully agree that we need a container library inside ... Just like the STL did. ... > I think the STL killed off all the other container libraries because ... string::string (int value) ...
    (comp.lang.ada)