Article View: gnu.g++.lib.bug
Article #327Problem with strstream
From: Tan Chee Weei
Date: Thu, 12 Nov 1992 06:07
Date: Thu, 12 Nov 1992 06:07
21 lines
1303 bytes
1303 bytes
Previously using gcc-2.2.2 and libg++ 2.1, I was able to do the following: strstream msg; msg << ' ' << "abc"; Right now I've upgraded to gcc-2.3.1 and libg++ 2.2. The ' ' character is giving problems: undefined strstream operator << () msg << ' '; // can't find << operator msg << "abc" << ' '; // ok Explicitly casting msg to an ostream& works as well. I noticed that iostream derives from ios and not istream and ostream like in the AT&T implementation, and it uses defines istream and ostream conversion functions. I can understand why the second case works since the first << returns an ostream &. It seems, for the first case, that there is a problem in implicitly converting msg to an ostream & so that the correct << operator may be matched?? Is there a fix for it? CW
Technical Details
Message-ID:
<1992Nov12.060751.13302@nuscc.nus.sg>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!constellation!convex!convex!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!solomon.technet.sg!ctanShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.lib.bug Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!constellation!convex!convex!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!solomon.technet.sg!ctan From: ctan@solomon.technet.sg (Tan Chee Weei) Subject: Problem with strstream Message-ID: <1992Nov12.060751.13302@nuscc.nus.sg> Sender: gnulists@ai.mit.edu Organization: National University of Singapore Distribution: gnu Date: Thu, 12 Nov 1992 06:07:51 GMT Approved: bug-lib-g++@prep.ai.mit.edu Lines: 22