Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.lang.c++ Subject: Re: inline management (source included) Message-ID: Date: 24 Jan 91 19:51:06 GMT References: <1991Jan22.213115.8716@ctr@italy.eu.net> Sender: davidm@cimshop.UUCP Distribution: comp Organization: Consilium Inc., Mountain View, California Lines: 32 In-reply-to: nicb@ctr@italy.eu.net's message of 22 Jan 91 21:31:15 GMT X-Posting-Software: GNUS 3.12 [ NNTP-based News Reader for GNU Emacs ] >>>>> On 22 Jan 91 21:31:15 GMT, nicb@ctr@italy.eu.net (Nicola Bernardini) said: Nicola> My problem is the following: Nicola> 1) I do not want to keep inlines in the definition files (.h) because Nicola> I want to be able to move my functions in and out of inlining whenever Nicola> I need to do so, without changing header files to my clients. Presumably, the header files in declaring a class would declare its member functions. These declarations should include a specification as to whether they are inlined or not (even if the definition is not in the header file). Otherwise, the C++ compiler might set up an 'outlined' reference that it expects it will need to fill in later (saw this in C++ 1.2 -- don't know if it changed). Basically, if your clients don't see that certain functions are inlined, how could they 'do the right thing' with your objects? Nicola> 2) If I do not inline inside the header file, I have to provide inline Nicola> declarations wherever I actually use these inlines thus generating a Nicola> lot of duplicate code. Your suggestion of building a .INL file could work especially if the .INL includes the .H file. Then, as you use objects, you just include the .INL to define the object and not the .H. Then again, though, doing this means that your .INL file is a .H file under a different name. What would you have gained? -- ==================================================================== David Masterson Consilium, Inc. (415) 691-6311 640 Clyde Ct. uunet!cimshop!davidm Mtn. View, CA 94043 ==================================================================== "If someone thinks they know what I said, then I didn't say it!"