Inadequacies of __traits

Kirk McDonald kirklin.mcdonald at gmail.com
Fri Jul 27 16:11:26 PDT 2007


BCS wrote:
> Reply to Kirk,
> 
>> 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.
>>
> 
> I'd post this as a comment but, I don't have a Google account.
> off the cuff
> 
> ctor might be usable like this:
> 
> (cast(Foo)(new byte[Foo.sizeOfObject]).ptr)._ctor(100)
> 
> 

The primary issue I have with with _ctor is that you cannot use it to 
get the signatures of all of the class's constructors (just of the 
lexically first constructor). My second concern is that the 
isFooFunction traits don't report what kind of function it is correctly.

-- 
Kirk McDonald
http://kirkmcdonald.blogspot.com
Pyd: Connecting D and Python
http://pyd.dsource.org



More information about the Digitalmars-d mailing list