Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!ukc!dcl-cs!aber-cs!rupert!pcg From: pcg@rupert.cs.aber.ac.uk (Piercarlo Grandi) Newsgroups: comp.lang.c++ Subject: Re: internal linkage for member functions? Message-ID: Date: 28 Mar 90 15:46:40 GMT References: <14373@cit-vax.Caltech.Edu> <10628@alice.UUCP> Sender: pcg@aber-cs.UUCP Organization: Coleg Prifysgol Cymru Lines: 27 In-reply-to: ark@alice.UUCP's message of 26 Mar 90 16:04:43 GMT Posting-Front-End: GNU Emacs 18.47.1 of Wed Mar 15 1989 on rupert (berkeley-unix) In article <10628@alice.UUCP> ark@alice.UUCP (Andrew Koenig) writes: On the other hand, if you make it plain that the second `m' is an attempt to define the first: struct c { int i; int m(int = 0); }; static int c::m (auto int j) { return this->i*j; } Yes, a typo. Even I do typos occasionally, ok? :-). you will find that indeed you cannot say `static' for a member function: error: static specified for qualified name m() Shame on cfront. G++ gets it "right". I only have Lippman as far as 2.0 goes, but I am at a loss to find a specific prohibition. And if it is in the Ugly Red Book, shame on it as well. :-). There is of course another course/curse :->; one can declare the member function inline which implies static/internal linkage. If it is suitably large cfront will refuse to actually inline it, and so you "win" :-(. Bleah. -- Piercarlo "Peter" Grandi | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk Dept of CS, UCW Aberystwyth | UUCP: ...!mcvax!ukc!aber-cs!pcg Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk