Topic: Conspiracy against I/O width
Author: "parksie ;-\)" <bwaarkboktimmay@parksie.net>
Date: Tue, 25 Jun 2002 21:36:39 GMT Raw View
This may be of interest:
http://www.boost.org/libs/io/doc/ios_state.html
"Scott Robert Ladd" <scott@coyotegulch.com> wrote in message
news:9A1Y7.228426$oj3.40086581@typhoon.tampabay.rr.com...
> Perhaps, in C++0X, a new stream boolean attribute could be "sticky",
> defining the behavior of formatting attributes? I don't think it would
break
> any existing code or backward compatibility.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: "Rob Staveley \(Tom\)" <rstaveley@seseit.com>
Date: Wed, 26 Jun 2002 15:50:38 GMT Raw View
State conspiracy? Wow ;-)
"parksie ;-)" <bwaarkboktimmay@parksie.net> wrote in message
news:afagj2$9b8$1@helle.btinternet.com...
> This may be of interest:
>
> http://www.boost.org/libs/io/doc/ios_state.html
>
> "Scott Robert Ladd" <scott@coyotegulch.com> wrote in message
> news:9A1Y7.228426$oj3.40086581@typhoon.tampabay.rr.com...
> > Perhaps, in C++0X, a new stream boolean attribute could be "sticky",
> > defining the behavior of formatting attributes? I don't think it would
> break
> > any existing code or backward compatibility.
>
>
> ---
> [ comp.std.c++ is moderated. To submit articles, try just posting with ]
> [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
> [ --- Please see the FAQ before posting. --- ]
> [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
>
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: dwalker07@snet.net.invalid (Daryle Walker)
Date: Mon, 31 Dec 2001 01:25:52 CST Raw View
>From the C++ books I've read, it seems that there is a conspiracy
against the width attribute of I/O streams. It is the only attribute
that is not sticky between formatted prints. But a stream cannot
spontaneously make an attribute reset to a default value; all the
formatted printing operators, at least for user-defined types, are
supposed to support a conspiracy to reset the width to 0 after a print.
Why should the width be non-sticky, especially since we have to do extra
work to support it? Did some old C and/or C++ implementation have the
width naturally non-sticky (with volatile?), and we're just parroting
that mistake/"feature"?
--
Daryle Walker
Mac, Internet, and Video Game Junkie
dwalker07 AT snet DOT net
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
Author: James Kanze <kanze@gabi-soft.de>
Date: Mon, 31 Dec 2001 07:25:59 CST Raw View
dwalker07@snet.net.invalid (Daryle Walker) writes:
|> From the C++ books I've read, it seems that there is a conspiracy
|> against the width attribute of I/O streams. It is the only
|> attribute that is not sticky between formatted prints. But a stream
|> cannot spontaneously make an attribute reset to a default value; all
|> the formatted printing operators, at least for user-defined types,
|> are supposed to support a conspiracy to reset the width to 0 after a
|> print. Why should the width be non-sticky, especially since we have
|> to do extra work to support it? Did some old C and/or C++
|> implementation have the width naturally non-sticky (with volatile?),
|> and we're just parroting that mistake/"feature"?
IMHO, the problem is the reverse: why are any formatting attributes
sticky? It leads to some surprising behavior, and requires a
responsible user to remember the previous state and restore it.
--
James Kanze mailto:kanze@gabi-soft.de
Conseils en informatique orient e objet/
Beratung in objektorientierter Datenverarbeitung
Ziegelh ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(0)179 2607481
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
Author: "P.J. Plauger" <pjp@dinkumware.com>
Date: Tue, 1 Jan 2002 10:13:55 CST Raw View
"Daryle Walker" <dwalker07@snet.net.invalid> wrote in message news:1f56ot0.cc8976ri1e0gN%dwalker07@snet.net.invalid...
> >From the C++ books I've read, it seems that there is a conspiracy
> against the width attribute of I/O streams. It is the only attribute
> that is not sticky between formatted prints. But a stream cannot
> spontaneously make an attribute reset to a default value; all the
> formatted printing operators, at least for user-defined types, are
> supposed to support a conspiracy to reset the width to 0 after a print.
> Why should the width be non-sticky, especially since we have to do extra
> work to support it? Did some old C and/or C++ implementation have the
> width naturally non-sticky (with volatile?), and we're just parroting
> that mistake/"feature"?
Yes.
P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
Author: "Scott Robert Ladd" <scott@coyotegulch.com>
Date: Tue, 1 Jan 2002 10:14:14 CST Raw View
Perhaps, in C++0X, a new stream boolean attribute could be "sticky",
defining the behavior of formatting attributes? I don't think it would break
any existing code or backward compatibility.
--
Scott Robert Ladd
Master of Complexity, Destroyer of Order and Chaos
Visit CoyoteGulch at http://www.coyotegulch.com
No ads -- just info, algorithms, and very free code.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]