Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!xylogics!samsung!uunet!bellcore!bytor From: bytor@ctt.bellcore.com (Ross Huitt) Newsgroups: comp.lang.c++ Subject: Re: problem with istream and filebuf Keywords: istream is, filebuf, String class, Turbo C++ Message-ID: <1991Jan22.222350.9466@bellcore.bellcore.com> Date: 22 Jan 91 22:23:50 GMT References: <1991Jan22.125100.26331@rivm.nl> Sender: usenet@bellcore.bellcore.com (Poster of News) Followup-To: comp.lang.c++ Organization: Computer Technology Transfer, Bellcore Lines: 37 In article <1991Jan22.125100.26331@rivm.nl> mtvrk@rivm39.rivm.nl (Rob Kok) writes: > >I am trying to port a String-library from Interactive 386/ix to Turbo C++ >1.0. On Interactive I have Glockenspiel C++. >Everything seems to work fine, but I have one small problem compiling >with Turbo C++. > // code deleted.... >-----begin code ---- >#define RDBUFSIZE StringIndex( 256 ) > >StringIndex String::Read( const filebuf& fb, Boolean Joinlines ) ^^^^^^^^^^^^^^^^^^ >{ > istream is( &fb ); > return Read( is, Joinlines ); >} >----end code----- > >When compiling with the Turbo C++ compiler, the compiler gives an error >on the line 'istream is( &fb )' : > > Type mismatch in parameter 1d in call to 'istream::istream(streambuf far*)' ^^^^^^^^^^^^^^ > >while the Glockenspiel compiler didn't complain. > > EMAIL : mtvrk@rivm39.rivm.nl FAX : +31 30 250740 >------------------------------------------------------------------------ Looks to me like you tried to pass a 'const' object to a method expecting a non-'const' argument. Page 320 of E&S provides an example and the details are described elsewhere in 13.2. -ross aka bytor@ctt.bellcore.com