This is the mail archive of the gcc-help@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: How to construct an object derived from class ostream in g++ version 3


>>>>> "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


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