User Defined Attributes

Max Samukha maxsamukha at gmail.com
Tue Nov 6 04:18:46 PST 2012


On Tuesday, 6 November 2012 at 07:55:51 UTC, Walter Bright wrote:

> =====================================================
> User Defined Attributes
> -----------------------
>

Attributes on overloads are critical. Currently fails:

module test;

[1] void foo();
[2] void foo(int x);

template Tuple(A...)
{
     alias A Tuple;
}

void main()
{
     foreach (o; __traits(getOverloads, test, "foo"))
     {
         alias Tuple!(__traits(getAttributes, o)) attrs;
         pragma(msg, attrs.stringof);
     }
}

Compiler outputs:
()
()



More information about the Digitalmars-d-announce mailing list