shared_ptr有个构造函数不知其用途
c++吧
全部回复
仅看楼主
level 9
IsaacMoo
楼主
template <class U>
shared_ptr(const shared_ptr<U> & x, element_type * p) noexcept;
调用这个构造函数会发生什么?x是常引用,它的状态应该不会变吧?
2013年11月16日 14点11分
1
level 14
liu0hy😂
如果A类指针能转换成B类指针,那A类智能指针也应该能转换成B类智能指针
2013年11月16日 16点11分
2
level 12
贴吧用户_0JNJWtE684
http://en.cppreference.com/w/cpp/memory/shared_ptr/shared_ptr
2013年11月16日 20点11分
3
IsaacMoo
多谢,茅塞顿开。
2013年11月17日 08点11分
level 7
Bing_loves_LT
我一直在纠结 现在到底该用std::shared_ptr还是boost::shared_ptr
2013年11月17日 00点11分
4
IsaacMoo
用std,将来boost库可能会把shared_ptr去掉。
2013年11月17日 08点11分
1