Counterproposal for extending static members and constructors

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Jul 12 10:37:20 PDT 2012


On Thu, Jul 12, 2012 at 06:25:03PM +0200, David Piepgrass wrote:
> I'm putting this in a separate thread from
> http://forum.dlang.org/thread/uufohvapbyceuaylostl@forum.dlang.org
> because my counterproposal brings up a new issue, which could be
> summarized as "Constructors Considered Harmful":
> 
> http://d.puremagic.com/issues/show_bug.cgi?id=8381

So, if I understand your proposal correctly, you're essentially saying
that the ctor of a given class C may return a derived class of C instead
of just C itself?

Isn't this just the "object factory" pattern in disguise?


T

-- 
It is impossible to make anything foolproof because fools are so ingenious. -- Sammy


More information about the Digitalmars-d mailing list