Custom attributes (again)
Manu
turkeyman at gmail.com
Fri Apr 6 04:20:42 PDT 2012
On 6 April 2012 13:23, Walter Bright <newshound2 at digitalmars.com> wrote:
> On 4/6/2012 2:54 AM, Timon Gehr wrote:
>
>> Should add additional information to the type Foo. I don't see any issues
>> with
>> it, and not supporting it would be very strange.
>>
>
> How would:
>
> @attr(foo) int x;
> int y;
>
> work? Are x and y the same type or not?
Yes they are the same type.
> Now, consider:
>
> auto c = b ? x : y;
>
c was not attributed, and has no attributes.
@blah auto c = b ? x : y; // NOW 'c' is attributed with 'blah', as useless
as that is :)
Attributes are on the declaration, and not passed around.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120406/7fa33bff/attachment.html>
More information about the Digitalmars-d
mailing list