From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29583 invoked by alias); 18 Jun 2002 22:35:44 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 29509 invoked from network); 18 Jun 2002 22:35:33 -0000 Received: from unknown (HELO wh2-19.st.uni-magdeburg.de) (141.44.162.19) by sources.redhat.com with SMTP; 18 Jun 2002 22:35:33 -0000 Received: by wh2-19.st.uni-magdeburg.de (Postfix, from userid 1000) id 4CC15A058; Wed, 19 Jun 2002 00:35:36 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15631.46519.595365.63984@wh2-19.st.uni-magdeburg.de> Date: Tue, 18 Jun 2002 15:35:00 -0000 From: "Claudio Bley" To: "Edwin Chan/Toronto/IBM" Cc: gcc-help@gcc.gnu.org Subject: Re: How to construct an object derived from class ostream in g++ version 3 In-Reply-To: References: X-SW-Source: 2002-06/txt/msg00171.txt.bz2 >>>>> "Edwin" == Edwin Chan/Toronto/IBM writes: Edwin> Here's a test file to show what I really meant. #include Edwin> class PageStream: virtual public ios, public Edwin> ostream{ public: PageStream(); }; Edwin> PageStream::PageStream(){} int main(){return 0;} Edwin> candidates are: std::basic_ostream<_CharT, Edwin> _Traits>::basic_ostream(const std::basic_ostream<_CharT, Edwin> _Traits>&) [with _CharT = char, _Traits = Edwin> std::char_traits] Edwin> /.../torolab.ibm.com/fs/projects/vabld/run/gcc/3.0.3/include/g++-v3/bits/std_ostream.h:67: Edwin> std::basic_ostream<_CharT, Edwin> _Traits>::basic_ostream(std::basic_streambuf <_CharT, Edwin> _Traits>*) [with _CharT = char, _Traits = Edwin> std::char_traits] Edwin> What is required to match the function call? Is there Edwin> something missing in the constructor? GCC already told you which constructors are available. You're trying to use the default constructor of class ostream which is declared protected in its base class basic_ios<>. You need to use one of the other constructors: ostream(streambuf*) or ostream(const ostream&) Claudio