TITLE: the scope of function and class names (Newsgroups: comp.lang.c++.moderated, 8 Oct 97) GORMAN: Art Gorman >Does the function signature constitute the type of the function? CLAMAGE: stephen.clamage@eng.Sun.COM (Steve Clamage) The signature of a function is its name plus parameter types. The type of a function is its return type plus its parameter types. (That is, the function's signature includes its name but not its return type; the function's type includes its return type but not its name.) But these distinctions are not the source of your problem. GORMAN: >If I have a routine that defines a class and a function with identical >names in the same scope CLAMAGE: Valid, but not a good idea. It is better to use different names for different things when you have the option. (C++ originally did not allow such name duplication, but the rule was relaxed for class names because of C compatibility issues. C does not allow any other sort of name duplication, and neither does C++.) GORMAN: > The problem arises >when you turn the "struct a" into a "template struct a" ... CLAMAGE: That violates a rule. A template name cannot be the same as the name of any other entity declared in the same scope.