Glad and WGL

userABCabc123 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 13 18:16:40 PST 2016


On Wednesday, 13 January 2016 at 19:05:30 UTC, Josh Phillips 
wrote:
> Oh wow that's easy. They should really make that more clear in 
> the dlang reference. They way it sounds there made me think 
> that if a function doesn't throw any errors it automatically is 
> 'nothrow'

No, because actually you can have a function that uses 
sub-functions that throw, but marked explicitly nothrow, because 
it hides the stuff under the carpet.

---
void bar()
{
     throw new Exception("kaboom");
}

void foo() nothrow
{
   try {bar;}
   catch {/*under the carpet*/}
}
---

and that will compile.


More information about the Digitalmars-d-learn mailing list