TITLE: reducing namespace pollution (Newsgroups: comp.lang.c++.moderated, 27 Apr 97) KLEEMAN: Robert Kleemann > Is it possible to declare a class at file scope? ie, a class that has > no external linkage? > Often I have classes declared only in the CPP file and it seems a shame > to litter the global name space. OLIVA: Alexandre Oliva Use an unnamed namespace: namespace { class foo { /* ... */ }; } // foo is visible here, but not in any other translation unit. In fact, the usage of `static' in namespace scope is deprecated in favor of this alternative.