Re: Regarding nothrow and @safe

2011-08-25 Thread Nick Sabalausky
Jacob Carlborg d...@me.com wrote in message news:j2qn7n$1db7$1...@digitalmars.com... On 2011-08-21 02:26, Jonathan M Davis wrote: The short answer: You don't. It's an incredibly bad idea. The long answer: You catch Error - or OutOfMemoryError if you want that specific one. So, you could try

Re: Regarding nothrow and @safe

2011-08-25 Thread Jonathan M Davis
On Thursday, August 25, 2011 11:38 Nick Sabalausky wrote: Jacob Carlborg d...@me.com wrote in message news:j2qn7n$1db7$1...@digitalmars.com... On 2011-08-21 02:26, Jonathan M Davis wrote: The short answer: You don't. It's an incredibly bad idea. The long answer: You catch Error - or

Re: Regarding nothrow and @safe

2011-08-21 Thread Jacob Carlborg
On 2011-08-21 02:26, Jonathan M Davis wrote: On Saturday, August 20, 2011 18:18:25 Sean Eskapp wrote: bearophile: As far as I know they have decided to make memory overflow errors, so they are not exceptions, you can't catch them. Other people will confirm this or not. In this case, how

Re: Regarding nothrow and @safe

2011-08-20 Thread bearophile
Sean Eskapp: Does nothrow mean the function itself does not through exceptions, or that the function body, as well as any called functions, do not throw? I wonder because allocating new memory inside a @safe nothrow function works, even though I'm used to new allocations throwing exceptions

Re: Regarding nothrow and @safe

2011-08-20 Thread Timon Gehr
On 08/20/2011 08:18 PM, Sean Eskapp wrote: bearophile: As far as I know they have decided to make memory overflow errors, so they are not exceptions, you can't catch them. Other people will confirm this or not. In this case, how would you go about handling out-of-memory situations? A systems

Re: Regarding nothrow and @safe

2011-08-20 Thread Sean Eskapp
== Quote from Timon Gehr (timon.g...@gmx.ch)'s article On 08/20/2011 08:18 PM, Sean Eskapp wrote: bearophile: As far as I know they have decided to make memory overflow errors, so they are not exceptions, you can't catch them. Other people will confirm this or not. In this case, how

Re: Regarding nothrow and @safe

2011-08-20 Thread Jonathan M Davis
On Saturday, August 20, 2011 18:18:25 Sean Eskapp wrote: bearophile: As far as I know they have decided to make memory overflow errors, so they are not exceptions, you can't catch them. Other people will confirm this or not. In this case, how would you go about handling out-of-memory

Re: Regarding nothrow and @safe

2011-08-20 Thread Jonathan M Davis
On Saturday, August 20, 2011 16:41:01 Sean Eskapp wrote: Does nothrow mean the function itself does not through exceptions, or that the function body, as well as any called functions, do not throw? I wonder because allocating new memory inside a @safe nothrow function works, even though I'm