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 4 of 5 Topic 9568 of 9831
Post > Topic >>

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

by "sebor@[EMAIL PROTECTED] " <sebor@[EMAIL PROTECTED] > May 8, 2008 at 09:43 PM

On May 3, 6:13 am, Daniel Krügler <daniel.krueg...@[EMAIL PROTECTED]
>
wrote:
> On 2 Mai, 12:43, "Bo Persson" <b...@[EMAIL PROTECTED]
> 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?

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.

>
> No, I agree with your analysis. Additionally the proposed
> resolution references the wrong section by saying in
> [ostream.unformatted]/7:
>
> "Behaves as an unformatted output function (as described in
> 27.6.2.6.1,
> paragraph 1).[..]"
>
> because 27.6.2.6.1/p.1 describes the semantic of *formatted*
> output functions.

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]).


-- 
      [ 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 26 2:57:22 CDT 2008.