It shoudn't compile. Virtual bases are initialized by the most derived class which is Join
. Join
doesn't explicitly initialize Base
but Base
has no accessible default constructor.
[It also won't compiler because definitions of classes need to be terminated with a ;
but I've assumed that this is a typo. main
should also return int
and I've assumed that j.x
is a typo for j->x
.]