Subj : Re: Not using .cpp files when programming... To : comp.programming From : alfps Date : Wed Jul 20 2005 08:59 am * Arthur J. O'Dwyer: > > On Wed, 20 Jul 2005, Alf P. Steinbach wrote: > > > > robertwessel2@yahoo.com wrote: > >> Or, if you make the member > >> functions static or inline in the class to avoid the name space problems, > > > > Sorry, that's incorrect: neither 'inline' nor 'static' is used to avoid > > name space problems. > > Well, last I checked, 'static int foo;' (at file scope) meant an int > called 'foo' whose scope didn't extend outside the current compilation > unit. So 'static' is definitely used to avoid namespacing problems. 'static' in a class (what the OP referred to) has a very different meaning; 'static' variables at file scope in a header file, which you refer to, isn't a great idea because every compilation unit gets a copy and because it's deprecated usage, not guaranteed to survive C++0x; and anyway, that use of 'static' denotes linkage, not namespace and not scope; and just to be complete here, there's no scope that extends outside the current compilation unit. OK? Insert "sorry"-words etc. at will, I'm just too lazy... ;-) > Unless you're talking about the kind of name space problems that > lead to people calling their variables 'dfjas' instead of > 'difference_of_ja_squared'. Yep, that's what namespaces in C++ address. > I think that's an IAQ. AFAIK there's an IAQ for C but no such for C++, and Google elected to be less than helpful this time -- could you please elaborate? -- A: Because it messes up the order in which people normally read text. Q: Why is it such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? .