Aliases and UDA's

Manu via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 31 05:01:02 PST 2014


I tried that. It doesn't work.
It's also not really what I want.
On 31/12/2014 9:35 pm, "Jacob Carlborg via Digitalmars-d" <
digitalmars-d at puremagic.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141231/6535204c/attachment.html>


More information about the Digitalmars-d mailing list