Although it is somewhat annoying that there is no default value for the
msg parameter in the first constructor, it is pretty easy to use the
mixin templates to overcome the issue:
public mixin template ExceptionCtorMixin() {
this(string msg = null, Throwable next = null) { super(msg,
The code below:
module used;
import std.stdio;
class ClassA {
this() { writeln(A ctor); }
~this() { writeln(A dtor); }
}
static this() { writeln(used.sctor); }
static ~this() { writeln(used.sdtor); }
void main() {
auto a = new ClassA();