DMD 1.035 and 2.019 releases

"のしいか (noshiika)" noshiika at gmail.com
Wed Sep 3 18:23:08 PDT 2008


Walter Bright wrote:
> Struct constructors!

Thanks for the nice release!

I have a question. The "dynamic initialization of struct" syntax seems
still using opCall. Is it going to replaced by constructors?

     struct S {
         this(int x) {
             writeln("ctor");
         }
         static S opCall(int x) {
             writeln("opCall");
             return S.init;
         }
     }

     void main(){
         S s = 1; // prints "opCall"
     }


More information about the Digitalmars-d-announce mailing list