custom attribute proposal (yeah, another one)

Piotr Szturmaj bncrbme at jadamspam.pl
Fri Apr 6 12:06:47 PDT 2012


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.

See also: http://forum.dlang.org/post/jlmtcv$v09$1@digitalmars.com


More information about the Digitalmars-d mailing list