Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!rutgers!gatech!bloom-beacon!eru!hagbard!sunic!kth.se!hemuli.tik.vtt.fi!James.Reilly From: James.Reilly@tel.vtt.fi (Jim Reilly) Newsgroups: comp.lang.c++ Subject: ostream/istream question Message-ID: <5257@hemuli.tik.vtt.fi> Date: 22 Nov 90 13:00:46 GMT Sender: news@hemuli.tik.vtt.fi Distribution: comp Organization: Technical Research Centre of Finland Lines: 52 Hey, I just got ObjectWorks C++ (1.02) that uses Cfront (2.0). I am having problems porting some code that constructs istreams from existing istreams. For example: #include main() { istream output(cout); } gives: put:"j.c", line 6: error: ostream::ostream() cannot access ios::ios(): private member What I'm trying to do is something like this: class Ostream { private: ostream& os; public: Ostream (ostream& out) : os(out) {} // ... }; Some Questions: Q1: Is there some reason why I shouldn't be able to construct streams from other streams, using the X(const X&) constructor ? Q2: Does anyone have any suggestions for what I should do in this case ? Q3: Has think been fixed in Cfront 2.1+ ? It seems to me much of this could be resolved if I could simply read the fd of the stream, but I don't think I can do this for an ostream/istream without cheating (unless it is an ifstream or ofstream), or am I just being brain dead and missing something completely obvious ? If anyone has any other helpful comments/hints/suggestions regarding the AT&T streams library, I'd be grateful to see them, as I don't have an AT&T Refernece Manual for Cfront available. please respond via e-mail to reilly@tel.vtt.fi, as I don't read NetNews too often. thanks ! jim -- Internet Mailbox: James.Reilly@tel.vtt.fi UUCP Mailbox: ...!{mcsun, uunet}!tel.vtt.fi!reilly