我有简单的基类和派生类,我希望它们都有shared_from_this()。这个简单的解决方案:classfoo:publicenable_shared_from_this{voidfoo_do_it(){coutget_callback(){returnboost::bind(&foo::foo_do_it,shared_from_this());}virtual~foo(){};};classbar1:publicfoo,publicenable_shared_from_this{usingenable_shared_from_this::shared_from_this;void