Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.lang.c++ Subject: Re: Inline style question Message-ID: Date: 9 Apr 90 17:22:42 GMT References: <154@dumbcat.UUCP> <156@dumbcat.UUCP> Sender: davidm@cimshop.UUCP Organization: Consilium Inc., Mountain View, California. Lines: 34 In-reply-to: cimshop!davidm@uunet.UU.NET's message of 9 Apr 90 00:04:27 GMT In article cimshop!davidm@uunet.UU.NET (David S. Masterson) writes: In article <156@dumbcat.UUCP> marc@dumbcat.UUCP (Marco S Hyman) writes: Inlines must be declared as such before they are used. The declaration can be part of a definition. This puts the programmer in the position of either declaring inlines within the class body or ensuring the functions are in a certain order. I know I'm gonna get hit about this, but... What's wrong with: class alpha { ... public: ... int beta(); }; ... inline int beta() { ... } // <== oops, I meant "alpha::beta" Slip of the keyboard, but I did mean "alpha::beta". As has been pointed out to me, this can still have problems if a reference to beta occurs before its use. I guess this is why my .H files contain the class declaration plus any inline definitions and my .C files contain the rest of the member function definitions. -- =================================================================== David Masterson Consilium, Inc. uunet!cimshop!davidm Mt. View, CA 94043 =================================================================== "If someone thinks they know what I said, then I didn't say it!"