| Howard Hinnant wrote:
|
| > <nod> It might. But the C++ standard says in section 24.5.2.2 -
| > ostream_iterator operations, paragraph 3:
| >
| > | ostream_iterator& operator++();
| > | ostream_iterator& operatot++(int);
| > |
| > | -3- Returns: *this
| >
| > (i.e. do nothing)
|
| Does that mean the same as if it specifically said that the operator
| does nothing?
Hmm... no, I think you're right. It could have other effects, though
I'm having trouble coming up with a quick realistic example. Maybe
some kind of debugging info?
| > I certainly would never write code that used ostream_iterator in an
| > unconventional manner that took advantage of this detail. And I'm not
| > suggesting anybody should. But if you want to get picky,
| > ostream_iterator:
perator++() is defined by the C++ standard to do
| > nothing but return *this.
|
| I didn't read in the standard, but in TC++PL3, which says:
|
| "The ++ operation might trigger an actual output operation, or it might
| have no effect. Different implementations will use different
| implementation strategies. Consequently, for code to be portable, a ++
| must occur between every two assignments to an ostream_iterator."
Well, the standard explicitly says that the output will occur under
op=(const T&) operator:
| ostream_iterator& operator=(const T& value );
|
| -1- Effects:
| *out_stream << value;
| if(delim != 0) * out_stream << delim;
| return (*this);
So I don't see how the op++ could also trigger output without really
messing things up.
| Ack.
Bill? Bill The Cat? Is that you?!! We've missed you soooo much!