From -5336792604815030683 X-Google-Language: ENGLISH,ASCII X-Google-Thread: f78e5,953748e81bf9ec65 X-Google-Attributes: gidf78e5,public From: kanze@gabi-soft.fr (J. Kanze) Subject: Re: Class String of Standard Date: 1998/06/14 Message-ID: #1/1 X-Deja-AN: 362655154 Approved: Fergus Henderson References: <6lcfss$q3v$1@duke.telepac.pt> <6lhfm1$q74$1@nnrp1.dejanews.com> <6lj1j8$34d$1@nnrp1.dejanews.com> <6lmmml$9sb$1@nnrp1.dejanews.com> <35814811.167E@wizard.net> X-Original-Date: 13 Jun 1998 10:46:59 +0200 Organization: GABI Software, S�rl. X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANYRff+EDnX0m9pzZAQE54wF+N+IzFrZkhtOImzvhAp7sKWU6MWW4xHYQ +GV+iNjCtsgnAGFtv9UtSYGbVaOz09dH =+cMI Newsgroups: comp.std.c++ James Kuyper writes: |> J. Kanze wrote: |> ... |> > A call to c_str or data DOES invalidate all iterators and references |> > into the string. |> |> I found a statement that c_str() and data() invalidate references |> returned by operator[]; since at() is defined in terms of operator[], |> those references are also invalidated. I couldn't find a similar |> statement about the iterators; where is it? 21.3/5: References, pointers, and iterators referring to the elements of a basic_string sequence may be invalidated by the following uses of that basic_string object: [...] -- Calling data() and c_str() member functions. I believe that this text was inserted (or extensively modified) in the FDIS, so if you are looking at CD2, it may not be the same. (There were significant problems in the definition of lifetime of iterators and references in the CD2.) -- James Kanze +33 (0)1 39 23 84 71 mailto: kanze@gabi-soft.fr GABI Software, 22 rue Jacques-Lemercier, 78000 Versailles, France Conseils en informatique orient�e objet -- -- Beratung in objektorientierter Datenverarbeitung --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]