User Defined Attributes

Adam D. Ruppe destructionator at gmail.com
Tue Nov 6 06:05:45 PST 2012


On Tuesday, 6 November 2012 at 13:55:49 UTC, Rory McGuire wrote:
> You can put the attribute on the function.

Yeah, but that's an awfully roundabout way to add an attribute to 
the parameter...

if it went on func params:
void foo([Hint("this does something")] string something) {}

otherwise we'd have to do something like

[ParamHint("something", "this does something")] void foo(string 
something) {}


Which isn't really ahead from the old hack of

enum attr_foo_someting = Hint("");

and has similar problems in matching names. It's a little better 
but not as good as it could be.


More information about the Digitalmars-d-announce mailing list