Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!uunet!oresoft!dan From: dan@oresoft.uu.net (Daniel Elbaum) Newsgroups: comp.lang.c++ Subject: Re: overload probelm? Message-ID: <1989Jul25.193755.5400@oresoft.uu.net> Date: 25 Jul 89 19:37:55 GMT References: <33951@grapevine.uucp> Reply-To: dan@oresoft.uu.net (Daniel Elbaum) Distribution: na Organization: Oregon Software, Portland, OR Lines: 31 In article <33951@grapevine.uucp> parker@sun.UUCP (Parker Waechter) writes: :The following piece of code generates an error, and I can't see why ... :class complex { ... : friend ostream& operator << (ostream& s, complex& comp); :}; : :ostream& complex::operator <<(ostream& s, complex& comp) :{ ... :} : :The error it generates is: :"comp2.C", line 14: error: operator <<() is not a member of complex : :why not? :---------------------- :parker@sun.com.uucp :These are my questions/opinions/problems - not Sun's A friend is not a member and so neither requires nor allows the member access syntax *::*. See section 8.5.10 of the C++ reference manual in The C++ Programming Language or sec. 11.4 of subsequent draft versions of the of the new reference manual. -- The workaday world must remain transparent to those who maintain it if they are to find inspired within them a vision of the history they create. ({uunet,tektronix,reed,sun!nosun,osu-cis,psu-cs}!oresoft!(dan)@oresoft.uu.net)