Re: std::map - erase+continue
From: Peter Gordon (petergo_at__deleteme_.netspace.net.au)
Date: 03/09/05
- Next message: Dmitry A. Kazakov: "Re: Teaching new tricks to an old dog (C++ -->Ada)"
- Previous message: Phil Staite: "Re: Reducing build-times for large projects."
- In reply to: Gernot Frisch: "Re: std::map - erase+continue"
- Next in thread: Gernot Frisch: "Re: std::map - erase+continue"
- Reply: Gernot Frisch: "Re: std::map - erase+continue"
- Reply: Andre Kostur: "Re: std::map - erase+continue"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 9 Mar 2005 09:07:23 +0000 (UTC)
"Gernot Frisch" <Me@Privacy.net> wrote in news:397qcfF5uq1i4U1
@individual.net:
> Actually my question was: will pointers to other elements stay when I
> remove/insert an element. (vector won't, list will keep pointers
> valid)
> -Gernot
>
Are you sure? In the following code fragment:
list::iterator itr;
list mylist;
for(itr = mylist.begin(); itr != mylist.end(); ++itr) {
// delete the last elemant in the list
}
What happens to the "itr != mylist.end()" test?
BTW, I'm not being smart, I don't know, but suspect
that it is highly compiler dependent.
- Next message: Dmitry A. Kazakov: "Re: Teaching new tricks to an old dog (C++ -->Ada)"
- Previous message: Phil Staite: "Re: Reducing build-times for large projects."
- In reply to: Gernot Frisch: "Re: std::map - erase+continue"
- Next in thread: Gernot Frisch: "Re: std::map - erase+continue"
- Reply: Gernot Frisch: "Re: std::map - erase+continue"
- Reply: Andre Kostur: "Re: std::map - erase+continue"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]