Three legitimate bugs? (D1.061)

Stewart Gordon smjg_1998 at yahoo.com
Sat May 29 07:24:16 PDT 2010


Steven Schveighoffer wrote:
<snip>
> Unlike some languages, D1 const does not imply static.  Which means you 
> are trying to define an S as containing an S, which would then contain 
> another S and so on.  This should work:

It's implying static in this context according to my testing.  Try this 
at home:

----------
import std.stdio;

const S S1 = S();
struct S {
     float value;
     static S opCall() {
         S s;
         s.value = 42;
         return s;
     }
     const S S2 = S();
}
pragma(msg, S.sizeof);
pragma(msg, S1.value);
pragma(msg, S.S2.value);
----------


More information about the Digitalmars-d-learn mailing list