custom attribute proposal (yeah, another one)

Tove tove at fransson.se
Fri Apr 6 11:17:39 PDT 2012


On Friday, 6 April 2012 at 17:44:25 UTC, Steven Schveighoffer 
wrote:
> 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

yes, exactly... well, once library designers start getting 
creative, one of the immediate benefits would be, easy to 
understand error-messages.


More information about the Digitalmars-d mailing list