User Defined Attributes

Walter Bright newshound2 at digitalmars.com
Tue Nov 6 01:08:25 PST 2012


On 11/6/2012 1:06 AM, Jonas Drewsen wrote:
> Wow! This is an early christmas gift.
>
> Just to be sure. Is the following also possible:
>
> ["Serializable"]
> class Foo
> {
>     int bar;
> }
>
> This will attach the UDA to the ClassDeclaration.
>
> The examples you've shown only attach UDAs to variable declarations.
>
> /Jonas
>

Yes, you can attach them to other symbols, including user defined types.


More information about the Digitalmars-d-announce mailing list