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.
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:
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...