private:
int offset;
byte ch;
}
ibstream::ibstream () : istream()
{ <- Error line points here
offset = 0;
ch = 0;
}
ibstream::ibstream (streambuf* sb) : istream(sb)
{
offset = 0;
ch = 0;
}
Now, in VS.NET, I try to recompile this code and it gives me an error on the
default constructor like the following:
c:\Appdev\...\pdfcrypt.cpp(81) : error C2512:
'std::basic_istream<_Elem,_Traits>' : no appropriate default constructor
available
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
I think it doesn't like the default construction of istream(). Is there an
easy work around for this, or will I have to look into redesigning?
There is no default constructor for std::basic_istream(). You will have to
construct it with a pointer to a basic_streambuf object as you do in the
second constructor for your ibstream class.
Antoon
Hi Leo,
try
ibstream::ibstream ()
: istream( 0 )
{
// ...
Greetings
Werner