Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!emory!wa4mei!nanovx!msa3b!kevin From: kevin@msa3b.UUCP (Kevin P. Kleinfelter) Newsgroups: comp.lang.c++ Subject: Re: Public vs Private header files in C++ Message-ID: <1667@msa3b.UUCP> Date: 9 Jun 91 18:57:20 GMT References: <5243@servax0.essex.ac.uk> <25231@well.sf.ca.us> Organization: Dun and Bradstreet Software, Inc., Atlanta, GA Lines: 38 warsaw@nlm.nih.gov (Barry A. Warsaw) writes: >>>>>> "Alfred" == Alfred Fontes writes: > Alfred> ... If you have inlines, they can immediately follow > Alfred> the end of the class definition. >This is a Really Good Suggestion. I'll second that, as this is the >C++ coding style we've adopted and have been using for several months. >... >// foo.h >class foo >{ > ... >inline int foo::number( void ) >{ > return( priv_number ); >}; Oddly enough, this can produce multiple definitions of int foo::number (void); with BC++, if you have "out of line inline functions" enabled. It will literally create a copy of the function in each module compiled. The solution I found was to turn off this option, or to use static inline int foo::number (void) ... Is the need to specify static a compiler anomaly or a language ambiguity? Of course, if you want it to be a static function (referencing no class members), you get something like: static inline static int foo::number(void); -- Kevin Kleinfelter @ DBS, Inc (404) 239-2347 ...gatech!nanoVX!msa3b!kevin Dun&Bradstreet Software, 3445 Peachtree Rd, NE, Atlanta GA 30326-1276