Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!ll-xn!ames!amdahl!pyramid!voder!apple!kanner From: kanner@Apple.COM (Herbert Kanner) Newsgroups: comp.lang.c++ Subject: subscription and function call operators Keywords: overloading Message-ID: <9146@apple.Apple.Com> Date: 28 Apr 88 18:06:34 GMT Organization: Development Systems Group, Apple Computer Lines: 28 Would anyone, especially Bjarne, care to enlighten me on the following point: 7.16.3 strongly suggests, but as I read it, does not actually legislate, that the operators operator() and operator[] must be members, not friends. An experiment quickly demonstrates that cfront does, in fact, legislate this. Take, for example, the class defined on page 181 of The Book. class assoc { pair* vec int max; int free; public: assoc(int); int& operator[](char*); }; cfront will not let me rewrite the public part as: public: assoc(int); friend int& operator[](assoc, char*); My question is: what is the logical necessity for this restriction? -- Herb Kanner Apple Computer, Inc. {idi, ios, nsc}!apple!kanner