I have an object (Z) which derives from two other objects (A and B).
A and B both derive from enable_shared_from_this<>, respectively enable
enable_shared_from_this<>
enable
Yep, your class will be derived from two distinct classes enable_shared_from_this and enable_shared_from_this, and have two different weak ref's
enable_shared_from_this
Trick from that answer allows to have one base class, because of virtual inheritance