D Language 2.0

BCS none at anon.com
Wed Jan 20 21:21:22 PST 2010


Hello Michel,

> Theoretically, I think you should be able to avoid GC calls in a
> function by using nothrow:
> 
> void func() nothrow {
> auto a = new char[1]; // error: may throw
> }
> Unfortunately, it doesn't seem to always work:
> 
> void func(string a, string b) nothrow {
> auto c = a ~ b; // no error?
> }
> But that's probably just a bug somewhere.
> 

IIRC there was a big long thread on if allocation failure was a fatal enough 
error to throw anyway with something that you aren't supposed to catch.





More information about the Digitalmars-d mailing list