Eliminate "new" for class object creation?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Oct 19 19:57:45 PDT 2009


Brad Roberts wrote:
> Why do we still have static opcall?  What role does it play that ctors don't?

Return "new C" for classes for consistency with structs :o).

class C {
     static opCall(T...)(T args) {
         return new C(args);
     }
     ...
}


Andrei



More information about the Digitalmars-d mailing list