This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/13624] Unsafe delimiter in ostream_iterator
- From: "peturr02 at ru dot is" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jan 2004 13:41:25 -0000
- Subject: [Bug libstdc++/13624] Unsafe delimiter in ostream_iterator
- References: <20040109043555.13624.jlquinn@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From peturr02 at ru dot is 2004-01-09 13:41 -------
> ostream_iterator(ostream_type& s, const charT* delimiter);
> 2 Effects: Initializes out_stream with s and delim with delimiter.
Taken at face value, this means that the constructor should be defined
"as if":
ostream_iterator(ostream_type& s, const charT* delimiter)
: out_stream(s), delim(delimiter) { }
and since delim is of type const charT*, no copy will be made, so I
think the current implementation is correct. A conforming program *can*
find out if the string is copied (by modifying the charT array after
construction of the ostream_iterator), so there isn't much choice here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13624