this(this) must be cheap and O(1)

Walter Bright newshound2 at digitalmars.com
Sat Sep 24 13:12:32 PDT 2011


On 9/24/2011 4:30 AM, Trass3r wrote:
> Don't memory allocations prevent a function from being nothrow?

No. The decision was made early on that out of memory are non-recoverable 
exceptions. Nothrow only pertains to recoverable exceptions.

The reasons are:

1. nothrow would be fairly useless if memory allocation could throw

2. in my experience, applications cannot realistically recover from out of 
memory. The best they can do is shut themselves down sanely


More information about the Digitalmars-d mailing list