On 2/13/15 4:08 PM, "Marc =?UTF-8?B?U2Now7x0eiI=?= <[email protected]>"
wrote:
On Friday, 13 February 2015 at 19:09:43 UTC, Tobias Pankrath wrote:
1. Throw preallocated exceptions is the way to go
.... and because noone has yet shown an explicit example:
void myThrowingNogcFunc() @nogc {
static const exc = new Exception("something went wrong");
throw exc;
}
As long as you don't need to pass a runtime argument to the constructor,
there's no need for emplace acrobatics.
shared static const, unless you want one per thread (doesn't make a
whole lot of sense, since it's const).
-Steve