Created on 2005-01-13.00:00:00 last changed 239 months ago
Notes from the April, 2005 meeting:
The question about the linkage of class members is already covered by 6.6 [basic.link] paragraph 5.
Suppose we've got this class definition:
struct X { void f(); static int n; };
I think I can deduce from the existing standard that the following member definitions are ill-formed:
static void X::f() { } static int X::n;
To come to that conclusion, however, I have to put together several things in different parts of the standard. I would have expected to find an explicit statement of this somewhere; in particular, I would have expected to find it in 9.2.2 [dcl.stc]. I don't see it there, or anywhere.
Gabriel Dos Reis: Or in 6.6 [basic.link] which is about linkage. I would have expected that paragraph to say that that members of class types have external linkage when the enclosing class has an external linkage. Otherwise 6.6 [basic.link] paragraph 8:
Names not covered by these rules have no linkage.
might imply that such members do not have linkage.
History | |||
---|---|---|---|
Date | User | Action | Args |
2005-05-01 00:00:00 | admin | set | messages: + msg1174 |
2005-01-13 00:00:00 | admin | create |