exceptions thrown by new / object constructor ?

Michal Minich michal.minich at gmail.com
Mon Nov 1 11:11:35 PDT 2010


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;
}


More information about the Digitalmars-d-learn mailing list