digitalmars.D.learn - exceptions thrown by new / object constructor ?
- Michal Minich (13/13) Nov 01 2010 What exceptions can be throw by object constructor / new expression?
- Kagamin (2/17) Nov 01 2010 GC can throw OutOfMemoryException
- Michal Minich (4/23) Nov 01 2010 http://www.digitalmars.com/d/2.0/phobos/std_gc.html
- Jesse Phillips (1/1) Nov 01 2010 I thought there was a Bug report on this, but I guess not. I say report ...
- Don (5/6) Nov 02 2010 This has already been fixed in svn, and will be in the next release. See...
- Michal Minich (3/12) Nov 02 2010 Great! Many thanks! This issue has greatly limited nothrow usage because...
What exceptions can be throw by object constructor / new expression? Following code fails to compile because compiler says that both functions foo and bar can throw. class C { nothrow this () {} } nothrow void foo () { auto c = new C; } nothrow void bar () { auto o = new Object; }
Nov 01 2010
Michal Minich Wrote:What exceptions can be throw by object constructor / new expression? Following code fails to compile because compiler says that both functions foo and bar can throw. class C { nothrow this () {} } nothrow void foo () { auto c = new C; } nothrow void bar () { auto o = new Object; }GC can throw OutOfMemoryException
Nov 01 2010
On Mon, 01 Nov 2010 15:17:11 -0400, Kagamin wrote:Michal Minich Wrote:http://www.digitalmars.com/d/2.0/phobos/std_gc.html in GC docs it says it throw OutOfMemoryException, but shouldn't that be OutOfMemoryError ? Isn't the docs just outdated...?What exceptions can be throw by object constructor / new expression? Following code fails to compile because compiler says that both functions foo and bar can throw. class C { nothrow this () {} } nothrow void foo () { auto c = new C; } nothrow void bar () { auto o = new Object; }GC can throw OutOfMemoryException
Nov 01 2010
I thought there was a Bug report on this, but I guess not. I say report it. Ether it should compile or the compiler should error that a constructor can not be nothrow.
Nov 01 2010
Jesse Phillips wrote:I thought there was a Bug report on this, but I guess not. I say report it. Ether it should compile or the compiler should error that a constructor can not be nothrow.This has already been fixed in svn, and will be in the next release. See bug 3020. nothrow is painful and limited in 2.050, but should be quite usable in 2.051.
Nov 02 2010
On Tue, 02 Nov 2010 15:58:51 +0100, Don wrote:Jesse Phillips wrote:Great! Many thanks! This issue has greatly limited nothrow usage because 'new' is so common.I thought there was a Bug report on this, but I guess not. I say report it. Ether it should compile or the compiler should error that a constructor can not be nothrow.This has already been fixed in svn, and will be in the next release. See bug 3020. nothrow is painful and limited in 2.050, but should be quite usable in 2.051.
Nov 02 2010