Why the @ in @safe? & UDAs
Daniel Kozak
kozzi11 at gmail.com
Wed Nov 6 23:39:30 PST 2013
On Thursday, 7 November 2013 at 00:13:49 UTC, Shammah Chancellor
wrote:
> My understanding is that @ attributes were for used-defined
> behavior only. Pure and nothrow, since the compiler
> implements behavior on those keywords, do not have the @ sign.
> So, why is @safe, @safe, and not just "safe".
>
> On the basis that @attributes should not have compiler defined
> behavior. Please take off the @ from the @safe. This would
> apply to @trusted as well.
>
Remove @ from @safe, @system and @trust or @property would lead
to add more keywords, which would be unpleasant (break existing
code and so on). More better would be to add @ sign to the others
(@nothrow, @immutable and @pure).
> ...not a class following some interface is asking for trouble.
What exactly do you mean?
More information about the Digitalmars-d
mailing list