Multiple inheritance with reference-counted objects

class ButtonRendererObj: virtual public x::obj {

// ...

};

class InputInterfaceObj: virtual public x::obj {

// ...

};

class ButtonObj : public ButtonRenderObj, public InputInterfaceObj {

// ...

};

x::ptr<ButtonRendererObj>> button;

x::ptr<InputInterfaceObj>> inputp;

// ...

inputp=button;

Multiple inheritance works as expected. Virtual inheritance of the x::obj superclass results in the derived object virtually inheriting a single instance of it, and references to any member of the inheritance hierarchy are convertible to any other member of the inheritance hierarchy.