Topic: Streambufs are noncopyable?
Author: dwalker07@snet.net (Daryle Walker)
Date: Thu, 29 May 2003 15:52:22 +0000 (UTC) Raw View
In some work I'm trying for Boost <http://www.boost.org>, I made a new stream-buffer class with a copy constructor. My code
works on one of my compilers (CodeWarrior) but not on another (GCC).
The GCC code highlighted an error in the definition of
std::basic_streambuf where the copy constructor and assignment operator
are declared private, making that class noncopyable. However the
standard has those two operations unspecified (in the normal-life sense,
not the C++ sense), so the class should have those operations
automatically defined. The GCC code mentioned a DR #50.
What is this DR about? Should it be recinded? Since streams are
explicitly noncopyable, my copy constructor won't get much use. So
should I just get rid of it (and hope no one does a copy)?
Daryle
---
[ 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: hinnant@metrowerks.com (Howard Hinnant)
Date: Thu, 29 May 2003 17:09:24 +0000 (UTC) Raw View
In article
<dwalker07-369320.00584729052003@newssvr10-ext.news.prodigy.com>,
Daryle Walker <dwalker07@snet.net> wrote:
| In some work I'm trying for Boost <http://www.boost.org>, I made a new
| stream-buffer class with a copy constructor. My code
| works on one of my compilers (CodeWarrior) but not on another (GCC).
| The GCC code highlighted an error in the definition of
| std::basic_streambuf where the copy constructor and assignment operator
| are declared private, making that class noncopyable. However the
| standard has those two operations unspecified (in the normal-life sense,
| not the C++ sense), so the class should have those operations
| automatically defined. The GCC code mentioned a DR #50.
I'm not aware of anything in the standard, or in the defects list
(including #50) that says a std::basic_streambuf is not copyable.
DR 50 states that ios_base is not copyable. And it is true that
Metrowerks currently allows ios_base to be copied. The semantics of
this support basic_ios::copyfmt. And non-copyability is introduced at
the basic_ios level.
| What is this DR about? Should it be recinded?
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#50
--
Howard Hinnant
Metrowerks
---
[ 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 (Daryle Walker)
Date: Mon, 2 Jun 2003 20:05:37 +0000 (UTC) Raw View
In article <290520031236059050%hinnant@metrowerks.com>,
hinnant@metrowerks.com (Howard Hinnant) wrote:
[SUMMARY: tried to make a copyable stream buffer class. Works on
Metrowerks. Doesn't work on GCC. GCC explictly makes streambuf
noncopyable, claiming DR 50 as the reason.]
> I'm not aware of anything in the standard, or in the defects list
> (including #50) that says a std::basic_streambuf is not copyable.
>
> DR 50 states that ios_base is not copyable. And it is true that
> Metrowerks currently allows ios_base to be copied. The semantics of
> this support basic_ios::copyfmt. And non-copyability is introduced at
> the basic_ios level.
As far as I can see, you [Metrowerks] has it right, and GCC has it
wrong. Especially if GCC mistakenly used DR 50 as the reason. Is there
an equivalent person from GCC around here to give an explaination?
> | What is this DR about? Should it be recinded?
>
> http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#50
Daryle
---
[ 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 ]