xxxxxxxxxx
import std.stdio;
import std.math;
import core.stdc.stdio: puts;
struct B
{
this(int b) {}
~this()
{
puts("B destructor");
}
}
struct A
{
B b;
this(int a)
{
b = B(2);
throw new Exception("throw in constructor");
}
~this()
{
puts("A destructor");
}
}
void main()
{
try
{
A a = A(1);
}
catch (Exception e)
{
writeln("catch");
}
writeln("scope exit");
}