DMD 1.027 and 2.011 releases

Ary Borenszweig ary at esperanto.org.ar
Mon Feb 25 00:07:31 PST 2008


Walter Bright escribió:
> Graham St Jack wrote:
>>> It would work just like "nothrow" does for C++.
>>
>> Just checking - I hope this means that if a nothrow function actually 
>> DID try to throw an exception (by calling something that throws), 
>> compiler-
>> generated code would trap it and terminate the program with an error 
>> message?
> 
> No, but it will try to detect errors at compile time.

Does this mean this will not compile:

int foo(int[] someArray, int someIndex) nothrow {
	return someArray[someIndex];
}

but this will:

int foo(int[] someArray, int someIndex) nothrow {
	if (someIndex < someArray.length) {
		return someArray[someIndex];
	} else {
		return -1;
	}
}


More information about the Digitalmars-d-announce mailing list