我有一个现有的变量,例如
int a = 3;
我现在如何才能创建一个boost::shared_ptr到a?例如:
boost::shared_ptr
a
boost::shared_ptr< int > a_ptr = &a; // this doesn't work
c++ boost smart-pointers shared-ptr
boost ×1
c++ ×1
shared-ptr ×1
smart-pointers ×1