相关疑难解决方法(0)

static_cast with boost :: shared_ptr?

什么是一个相当于static_castboost::shared_ptr

换句话说,我该如何重写以下内容

Base* b = new Derived();
Derived* d = static_cast<Derived*>(b);
Run Code Online (Sandbox Code Playgroud)

什么时候用shared_ptr

boost::shared_ptr<Base> b(new Derived());
boost::shared_ptr<Derived> d = ???
Run Code Online (Sandbox Code Playgroud)

c++ boost shared-ptr static-cast

72
推荐指数
2
解决办法
4万
查看次数

标签 统计

boost ×1

c++ ×1

shared-ptr ×1

static-cast ×1