Most basic nothrow, pure, @safe functions?
Joseph Rushton Wakeling
joseph.wakeling at webdrake.net
Wed Mar 19 01:59:23 PDT 2014
On 19/03/14 00:20, Steven Schveighoffer wrote:
> I think we all agree that there are some things that the compiler simply cannot
> prove are nothrow, but to be able to write useful nothrow code, we have to paste
> nothrow on there anyway.
Just to clarify my understanding here: exactly how much compiler checking _is_
done of nothrow? Is it simply to confirm that whatever is called by the
function contains no "throw" statements (hopefully all the way down ...), or is
there more ... ?
What I'm wondering is whether just as we have @safe and @trusted for the
situations where the compiler can verify and where the programmer has verified,
is there a case for complementing nothrow with another attribute ("wontthrow"?)
that's a programmer assurance rather than a compiler-checked guarantee?
I imagine if that was worthwhile someone would already have done it, but I'm
curious.
More information about the Digitalmars-d
mailing list