Aliases and UDA's
Jacob Carlborg via Digitalmars-d
digitalmars-d at puremagic.com
Wed Dec 31 03:33:11 PST 2014
On 2014-12-30 07:01, Manu via Digitalmars-d wrote:
> I've got this thing going on where I want to be able to attribute an
> alias, but that doesn't seem to work:
>
> @("hello")
> struct(X) S
> {
> X x;
> }
>
> @("world")
> alias A = S!int;
>
> Test!A;
>
> template(T) Test
> {
> // at this point, if T is some S, then the "hello" attribute is
> present, as expected
> // if T is A, "world" is lost
> }
>
> I guess the reason is that A is not really a thing; it is translated
> to S!int when being given to T?
> Is that the point where "world" is lost?
What if you make T an alias parameter, will that work?
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list