Re: How can I get this UDA at compile time?

2021-02-21 Thread Jack via Digitalmars-d-learn
On Sunday, 21 February 2021 at 09:30:14 UTC, Jacob Carlborg wrote: On 2021-02-21 07:12, Jack wrote: I've had a struct like this: struct Attr { string value; } struct Foo { @(Attr("a attr")) enum a = Foo(10); @(Attr("b attr")) enum b = Foo(11); int x; int

Re: How can I get this UDA at compile time?

2021-02-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2021-02-21 07:12, Jack wrote: I've had a struct like this: struct Attr { string value; } struct Foo { @(Attr("a attr")) enum a = Foo(10); @(Attr("b attr")) enum b = Foo(11); int x; int y; bool doY = true; int value() {     return

How can I get this UDA at compile time?

2021-02-20 Thread Jack via Digitalmars-d-learn
I've had a struct like this: struct Attr { string value; } struct Foo { @(Attr("a attr")) enum a = Foo(10); @(Attr("b attr")) enum b = Foo(11); int x; int y; bool doY = true; int value() {