Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!wiley!trwarcadia!simpson From: simpson@trwarcadia.uucp (Scott Simpson) Newsgroups: comp.lang.c++ Subject: Re: Arguments to Overloaded Operators Keywords: overloading Message-ID: <5043@wiley.UUCP> Date: 14 Jun 89 06:01:13 GMT References: <11032@orstcs.CS.ORST.EDU> <1100@cadillac.CAD.MCC.COM> <238@pink.ACA.MCC.COM> <868@tukki.jyu.fi> <244@pink.ACA.MCC.COM> <5023@wiley.UUCP> <884@tukki.jyu.fi> Sender: news@wiley.UUCP Reply-To: simpson@trwarcadia.UUCP (Scott Simpson) Organization: TRW Arcadia Project, Redondo Beach, CA Lines: 16 In article <884@tukki.jyu.fi> markku@jytko.jyu.fi (Markku Sakkinen) SAKKINEN@FINJYU.bitnet (alternative) writes: >If you look at subsection 8.2.1 (page 227) of Stroustrup, >you can see (among others) the output operator and function > ostream& operator<<(int) { ... } > ostream& put(char&); >Guess why there isn't > ostream& operator<<(char); >instead of the put function! But in the GNU C++ library there is. If you give GNU C++ the -fchar-const flag, it will call overloaded functions using the char version of <<. The default is to automatically convert it to an int. Scott Simpson TRW Space and Defense Sector oberon!trwarcadia!simpson (UUCP) trwarcadia!simpson@usc.edu (Internet)