|
|
Up |
  |
Author: Bo PerssonBo Persson Date: May 2, 2008 02:50
This would have gone to comp.std.c++, had it been active.
The resolution to issue 581
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2578.html#581
requires that basic_ostream::flush creates a sentry object to verify
the stream state.
However, for streams with the unit_buf flag set, like std::err, the
destructor of the sentry object will again call flush(). This seems to
create an infinite recursion for
std::cerr << std::flush;
or even
std::cerr << "Some message" << std::endl;
Have I missed something here?
Bo Persson
|
| |
|
| | 4 Comments |
|
  |
Author: Francis GlassborowFrancis Glassborow Date: May 2, 2008 10:50
Bo Persson wrote:
> This would have gone to comp.std.c++, had it been active.
Is it possible to find out what happened to comp.std.c++? Even better
would be to revive it as it provided an important and useful service
(and as we get closer to C++0x, it becomes more important to have a
newsgroup that deals with standard issues rather than coding ones)
|
| |
|
| | no comments |
|
  |
Author: Daniel KrüglerDaniel Krügler Date: May 3, 2008 04:20
On 2 Mai, 12:43, "Bo Persson" wrote:
> The resolution to issue 581
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2578.html#581
>
> requires that basic_ostream::flush creates a sentry object to verify
> the stream state.
>
> However, for streams with the unit_buf flag set, like std::err, the
> destructor of the sentry object will again call flush(). This seems to
> create an infinite recursion for
>
> std::cerr << std::flush;
>
> or even
>
> std::cerr << "Some message" << std::endl;
>
> Have I missed something here?
|
| Show full article (1.05Kb) |
| no comments |
|
  |
Author: seborsebor Date: May 8, 2008 20:43
On May 3, 6:13 am, Daniel Krügler googlemail.com>
wrote:
> On 2 Mai, 12:43, "Bo Persson" wrote:
>
>
>
>> The resolution to issue 581
>
>
>> requires that basic_ostream::flush creates a sentry object to verify
>> the stream state.
>
>> However, for streams with the unit_buf flag set, like std::err, the
>> destructor of the sentry object will again call flush(). This seems to
>> create an infinite recursion for
>
>> std::cerr << std::flush;
>
>> or even ...
|
| Show full article (1.60Kb) |
| no comments |
|
  |
Author: Daniel KrüglerDaniel Krügler Date: May 9, 2008 19:31
> The text in [ostream::sentry], p4 should probably be changed
> to read something like
>
> If ((os.flags() & ios_base::unitbuf) && !uncaught_exception())
> is true, calls os.rdbuf()->pubsync().
>
> to avoid this. Let me fix it along with the similar problem
> with the tied stream.
I agree with this..
> I think the numbers have changed between C++ 98 and the latest
> working paper. We should be using section names instead of
> numbers, they don't change (i.e., [ostream.unformatted]).
You are right in both points, as I just notice.
Let me add three related questions, which came to me while
I was searching of references to flush:
|
| Show full article (2.25Kb) |
| no comments |
|
RELATED THREADS |
  |
|
|
|