Uh... destructors?

Steven Schveighoffer schveiguy at yahoo.com
Wed Feb 23 09:51:37 PST 2011


On Wed, 23 Feb 2011 12:25:52 -0500, %u <wfunction at hotmail.com> wrote:

>> Programmers are allowed to make conceptually safe functions which
> are not marked as @safe, why not the same for pure functions?
>
> Programmers can always shoot themselves in the foot anyway, if they
> really want to. Why not just make it easier for them? :) (We could
> allow unsafe casts, for instance.)

All casts are inherently unsafe.

> Sorry, but that's the argument here...

No, that's not it.  The argument is that the 'compiler knows best' mode  
also known as @safe can get in the way of writing high performance code.   
When I can prove to myself that code is safe, but the compiler can't, I  
have to step into "unsafe" land.  To say pure functions cannot enjoy that  
ability is too limiting.

Note, you can *still* have pure @safe functions if you want to write code  
in that mode.  But pure implying @safe doesn't make sense.

-Steve


More information about the Digitalmars-d mailing list