|
From: Baptiste L. <gai...@fr...> - 2003-04-27 11:25:29
|
----- Original Message -----=20
From: Andre Baresel=20
To: CppTool Mailing List=20
Sent: Sunday, April 27, 2003 12:09 PM
Subject: Re: [Cpptool-develop] Declaration parsing started...
Declaration of class variables or variables of a namespace are using =
this syntax.
typedef int myint;
namespace nnnn {
extern int x;
}
myint ::nnnn::x =3D 0;
Note that the problem only appears in case of userdefined type. =
Since than the syntax
specifies, that a userdefined type can be specified using "::". For =
this reason we can not
stop reading after "myint" and have to continue with "::nnnn". The =
parser does not know
where to stop if a "::" follows.
A second example is the use of class variables:
class nnnn {
static int x;
};
myint ::nnnn::x =3D 0;
The second example is more of an issue than the first one. Though, I =
doubt we'll stumble uppon it often. In most case we can rely on the fact =
that the static will be declared within the namespace and the type won't =
be prefixed:
namespace nnnn {
myint x =3D 0;
}
Or :
myint nnnn::x =3D 0;
Have you ever seen code as you pointed out ? I don't think I did.
Baptiste.
PS: check your mailer configuration. I think that mail was in HTML. This =
makes it difficult to quote when replying.
|