Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Question on...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 5 Topic 9568 of 9807
Post > Topic >>

Re: Question on library issue #581, using a sentry in flush()

by =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@[EMAIL PROTECTED] May 9, 2008 at 09:23 PM

On 9 Mai, 05:43, "se...@[EMAIL PROTECTED]
" <se...@[EMAIL PROTECTED]
> wrote:
> 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:

1) N2588, [istream::sentry]/2, describes effects in terms of
flush on the result of is.tie(). Wouldn't it make sense to
refer here to is.tie()->rdbuf()->pubsync() as well? All other
effects of this c'tor are already based on rdbuf() functions
(of is).

2) I think that footnote 321, N2588, needs also to be adapted.

3) I have a question regarding [ios::Init]/4: The effects clause
of ~Init() says:

"Destroys an object of class Init. The function subtracts one from
the value stored in init_cnt and, if the resulting stored value is
one, calls cout.flush(), cerr.flush(), clog.flush(), wcout.flush(),
wcerr.flush(), wclog.flush()."

But because flush can (indirectly) throw a ios_base::failure,
I see two problems:

1) Does the standard need to rule this exception, although it
happens after program execution ([iostream.objects]/2)?

2) Actually worse seems to me that the standard seems not to
provide guarantees that such an intermediate throw does not
influence the outstanding flushs. What I mean is the following:
Consider that

cout.flush(), cerr.flush(),  ..

are called and cout.flush() throws. Will cerr.flush() and
all remaining flush()'s still be called? I would like to
hear such statement, but during a short survey I couldn't
find anything.

[Please note that these "issues" of (3) are not new, but
I just stumbled across them]

Greetings from Bremen,

Daniel Krügler


-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 5 Posts in Topic:
Question on library issue #581, using a sentry in flush()
"Bo Persson" &l  2008-05-02 04:43:30 
Re: Question on library issue #581, using a sentry in flush()
Francis Glassborow <fr  2008-05-02 12:46:04 
Re: Question on library issue #581, using a sentry in flush()
=?ISO-8859-1?Q?Daniel_Kr=  2008-05-03 06:13:27 
Re: Question on library issue #581, using a sentry in flush()
"sebor@[EMAIL PROTEC  2008-05-08 21:43:27 
Re: Question on library issue #581, using a sentry in flush()
=?ISO-8859-1?Q?Daniel_Kr=  2008-05-09 21:23:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 19 20:06:41 CDT 2008.