Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ogicse!emory!hubcap!ncrcae!secola!oiscola!dbarnhar From: dbarnhar@oiscola.Columbia.NCR.COM (David C. Barnhart II) Newsgroups: comp.lang.c++ Subject: Re: Inline style question Message-ID: <137@oiscola.Columbia.NCR.COM> Date: 9 Apr 90 17:18:24 GMT References: <154@dumbcat.UUCP> <156@dumbcat.UUCP> Reply-To: dbarnhar@oiscola.UUCP (David C. Barnhart II) Organization: NCR/OISD Columbia Lines: 40 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() { ... } > >You can then (potentially) do all your class declarations before doing any >inline definitions and finally the rest of the definitions. Well? > As long as the line reads: inline int alpha::beta() { ... } the above type of construct works just fine with Glockenspiel C++ 2.0a, and perhaps with other compilers as well, so you wouldn't have to declare your functions inline in the class definition. Dave Barnhart NCR Office Information Systems 3245 Platt Springs Rd. West Columbia, SC 29169 Hit 'n' now, inews fodder below . . .