This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/13624] Unsafe delimiter in ostream_iterator


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]