Inadequacies of __traits
Jarrett Billingsley
kb3ctd2 at yahoo.com
Fri Jul 27 16:59:56 PDT 2007
"Kirk McDonald" <kirklin.mcdonald at gmail.com> wrote in message
news:f8drd0$1i92$1 at digitalmars.com...
>I started writing this as a newsgroup post, but decided I'd rather make it
>a blog post:
>
> http://kirkmcdonald.blogspot.com/2007/07/inadequacies-of-traits.html
>
> __traits is a worthy addition to D, but it needs a couple more features to
> be truly useful.
>
Doesn't really help your problem, but just a bit of info to make the
constructor issue a little more lucid. The constructor really is just
another class method. Class construction works something like (1) allocate
the class's memory, either using the default method or using the overloaded
'new', (2) copy the static instance of the class into that memory, and (3)
call the _ctor method of the new instance. That's why (1) you can call
_ctor as an instance method and (2) it returns 'this', as returning 'this'
is why "new Foo()" gives you the instance -- you're really getting the
return value of _ctor.
But more on topic, hopefully Walter will be receptive to your comments this
time too.
More information about the Digitalmars-d
mailing list