Custom attributes (again)

Timon Gehr timon.gehr at gmx.ch
Fri Apr 6 02:54:19 PDT 2012


On 04/06/2012 09:54 AM, Walter Bright wrote:
> On 4/6/2012 12:49 AM, Alex Rønne Petersen wrote:
>> What about type declarations? I think those ought to be supported too.
>> E.g. it
>> makes sense to mark an entire type as @attr(serializable) (or the
>> inverse).
>
>
> That would make it a "type constructor", not a storage class, which we
> talked about earlier in the thread. I refer you to that discussion.

I think what was discussed there is that

@attr(foo) int x;

Wouldn't change the type of x.

@attr(foo) struct Foo{}

Should add additional information to the type Foo. I don't see any 
issues with it, and not supporting it would be very strange.


More information about the Digitalmars-d mailing list