Hi,
Reviewing a linkage problem with a static data member of my class (problem on AIX), I started to doubt on its linkage type.
# Internal linkage : identifiers can only be seen within a translation unit.
# External linkage : identifiers can be seen (and referred to) in other translation units.
If the identifier for a class has external linkage, then, in the implementation of that class, the identifiers for the following will also have external linkage:
* A member function.
* A static data member.
(http://publib.boulder.ibm.com/infoce...ef/cplr082.htm)
A named class has external linkage, of that I'm sure. The static data member in that class has therefore also external linkage, hasn't it?
The standard says the following:
ISO/IEC 14882:2003(E)
9 Classes
9.4.2 Static data members
6 Static data members of a class in namespace scope have external linkage (3.5). A local class shall not
have static data members.
But what exactly is meant by the specification "in namespace scope"? Should a class with a static data member always be defined in a named namespace? That would seem strange to me...
Thanks!