throws Exception in method

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 8 02:32:59 PDT 2014


amehat:

> What is the proper behavior for this D?

D doesn't have that Java syntax, because it was widely regarded 
as a Java design mistake. So in D omit the throws part. If your 
function tree doesn't throw exceptions (but it can throw errors) 
add a "nothrow".

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list