custom attribute proposal (yeah, another one)

Steven Schveighoffer schveiguy at yahoo.com
Fri Apr 6 10:44:25 PDT 2012


On Fri, 06 Apr 2012 13:33:33 -0400, Tove <tove at fransson.se> wrote:
> I think this proposal pretty much covers what I would expect from  
> 'custom attributes'... but what about adding a D twist, getting "what we  
> annotate" as a template parameter so that one among other things can  
> make use of Template Constraints?

Interesting, so something like:

@attribute string defaultName(T)() if(is(typeof(T.init.name))) { return  
T.init.name;}

Not sure how much this gives us, but it definitely feels doable.

-Steve


More information about the Digitalmars-d mailing list