Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!ncis!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!mailrus!caen.engin.umich.edu!yhe From: yhe@caen.engin.umich.edu (youda he) Newsgroups: comp.lang.c++ Subject: Zortech C++ overloading Message-ID: <40dcec16.1285f@maize.engin.umich.edu> Date: 14 Jan 89 17:47:00 GMT Reply-To: yhe@caen.engin.umich.edu (youda he) Organization: caen Lines: 30 Overloading operator<< and operator>> use user supplied data type is pain in Zortech C++, consider the following example: file foo.cpp: class foo { ... public: friend istream& operator<<(istream&, foo&); }; file bar.cpp: class bar { ... public: friend istream& operator<<(istream&, bar&); }; compile both files will generate two _lshift in each file, and try to link foo+bar there will be problems in find proper _lshift. If I put all "operator<<" definition in one file, only the first one will be cast as _lshift, the others will get a much longer name to indicate the proper usage, to occupy the first _lshift, I had to define a dummy class, put it's definition at the top of the "operator<<" file. I believe the solution will be to expand all overload functions to its full name, starting from the first one. The second question: should all friend functions be implicitly considered as overload? after look at the libg++ code, I think GNU C++ overload all friend function automatically.