如果我有两个课程,例如:
class Base : boost::noncopyable {
using ptr_type = std::shared_ptr<Base>;
}
class DerivedOne : public Base{
using ptr_type = std::shared_ptr<DerivedOne>;
}
class DerivedTwo : public SomeOtherBase{
using ptr_type = std::shared_ptr<DerivedTwo>;
}
如果我想使用下面指定的用法,我如何将DerivedOne::ptr_type
或DerivedTwo::ptr_type
与Base::ptr_type
进行比较?有没有办法做到这一点,就好像将DerivedOne
或DerivedTwo
与Base
进行比较?我的首选用法是:
if(DerivedOne::ptr_type == Base::ptr_type
)应该返回true。
由于