This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: Redirecting cerr, cout to a file.


Benjamin Kosnik writes:
 > 
 > > I looked in the FAQ for v3, and this one wasn't in there.  I'm using
 > > assignment in my program to redirect cerr and cout to a file.  I do this for
 > > debugging purposes, as the program uses fork().
 > 
 > please provide a code snippet that demonstrates what you are trying to 
 > do, and what you expect, and what you think is broken

Nothing is broken.  The original message says "I'm using assignment"
to redirect cerr and cout, and standard streams have no assignment
operator.  Class basic_ios explicitly makes operator= private and
undefined.

The standard way of doing this is to open up a filebuf, and reset cout 
and cerr's streambuf using rdbuf.


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