Article View: comp.std.c++
Article #2444Modifying STL containers via an iterator
From: brian (b.c.) white
Date: Tue, 07 Nov 1995 04:41
Date: Tue, 07 Nov 1995 04:41
21 lines
1227 bytes
1227 bytes
Does the STL define the case where a container is modified while
iterating through it?
Example: (forgive me if the syntax isn't perfect...)
class X x;
for (X::iterator ix=x.begin(); ix != x.end(); ix++) {
ix.erase();
}
Brian
( bcwhite@bnr.ca )
-------------------------------------------------------------------------------
In theory, theory and practice are the same. In practice, they're not.
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<47l8qe$9fk@bcarh8ab.bnr.ca>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 07 Nov 95 04:41:00 GMT Approved: fjh@cs.mu.oz.au X-Original-Date: Mon, 6 Nov 1995 15:15:26 +0000 From: "brian (b.c.) white" <bcwhite@bnr.ca> Message-ID: <47l8qe$9fk@bcarh8ab.bnr.ca> Subject: Modifying STL containers via an iterator Newsgroups: comp.std.c++ Organization: Bell-Northern Research Ltd. X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMJ7jg+EDnX0m9pzZAQHdcQF/d7U0fwAjYpYJ4jzT13ZuoDCu1yaqc0z5 RPylBcuP4tUYsgNADbGeBOO1JV7GRgw5 =ZcEj