相关疑难解决方法(0)

为现有变量创建boost :: shared_ptr

我有一个现有的变量,例如

int a = 3;
Run Code Online (Sandbox Code Playgroud)

我现在如何才能创建一个boost::shared_ptra?例如:

boost::shared_ptr< int > a_ptr = &a; // this doesn't work
Run Code Online (Sandbox Code Playgroud)

c++ boost smart-pointers shared-ptr

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

标签 统计

boost ×1

c++ ×1

shared-ptr ×1

smart-pointers ×1