This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to construct an object derived from class ostream in g++ version 3
- From: "Claudio Bley" <bley at cs dot uni-magdeburg dot de>
- To: "Edwin Chan/Toronto/IBM" <edwinc at ca dot ibm dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 19 Jun 2002 00:35:35 +0200
- Subject: Re: How to construct an object derived from class ostream in g++ version 3
- References: <OFAA37BDAD.09C912DB-ON85256BDC.006AD13E@torolab.ibm.com>
>>>>> "Edwin" == Edwin Chan/Toronto/IBM <edwinc@ca.ibm.com> writes:
Edwin> Here's a test file to show what I really meant. #include
Edwin> <iostream.h> 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<char>]
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<char>]
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