This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/7498: copy constructor of ostream (and ios) is private and it should not be!


The following reply was made to PR c++/7498; it has been noted by GNATS.

From: Phil Edwards <phil@jaj.com>
To: mdp@fnal.gov
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7498: copy constructor of ostream (and ios) is private and it should not be!
Date: Mon, 5 Aug 2002 12:35:08 -0400

 On Mon, Aug 05, 2002 at 04:22:39PM -0000, mdp@fnal.gov wrote:
 > The following program:
 > -----------------------------
 > #include "iostream"
 > #include "fstream"
 > void main() {
 >   ofstream file("test.dat");
 >   ostream a=file;
 >   a << "Hello\n";
 >   file.close();
 > }
 > -----------------------------
 > 
 > works on Visual C++
 
 Visual C++ is broken.
 
 > but on g++
 > gives the following error:
 
 Because the code is invalid.
 
 > Copy constructors of base_ios and derived classes should be public.
 
 No they shouldn't.  See section 27.4 of the C++ standard.
 
 -- 
 If ye love wealth greater than liberty, the tranquility of servitude greater
 than the animating contest for freedom, go home and leave us in peace.  We seek
 not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
 and may posterity forget that ye were our countrymen.            - Samuel Adams


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]