Why the @ in @safe? & UDAs
Daniel Kozak
kozzi11 at gmail.com
Thu Nov 7 01:11:55 PST 2013
On Thursday, 7 November 2013 at 08:45:33 UTC, Jacob Carlborg
wrote:
> On 2013-11-07 08:39, Daniel Kozak wrote:
>
>> What exactly do you mean?
>
> You can do this:
>
> @(1) void foo () { }
> @(1) void bar () { }
>
> Some library might treat @(1) in one way, and another library
> in a different way. If only user defined types were allowed the
> fully quailed name can be used do disambiguate the UDA's.
>
> module libA;
> struct attr { int a; }
>
> module libB;
> struct attr { int a; }
>
> @libA.attr(1) void foo () { }
> @libB.attr(1) void bar () { }
I get it! Thanks :)
More information about the Digitalmars-d
mailing list