C++ frequently questioned answers
Matti Niemenmaa
see_signature at for.real.address
Mon Oct 29 04:33:55 PDT 2007
Frits van Bommel wrote:
> Regan Heath wrote:
>> Ary Borenszweig wrote:
> [snip normal "static this" version]
>>> 2.
>>> ---
>>> import std.stdio;
>>>
>>> class X {
>>> static {
>>> this() {
>>> writefln("static");
>>> }
>>> }
>>> }
>>>
>>> void main() {
>>> }
>>> ---
>>
>> Has this been reported as a bug?
>
> IIRC Walter has said that "static this" needs to be two adjacent tokens
> for it to be parsed as such, and this is not a bug but working as designed.
And it's not only "Walter said", it's been explicitly stated in the doc for as
long as I can remember: http://digitalmars.com/d/1.0/class.html#StaticConstructor
"The static in the static constructor declaration is not an attribute, it must
appear immediately before the this"
--
E-mail address: matti.niemenmaa+news, domain is iki (DOT) fi
More information about the Digitalmars-d
mailing list