shared-ptr
Conversion from boost::shared_ptr to std::shared_ptr?
I got a library that internally uses Boost\'s version of shared_ptr and exposes only those. For my application, I\'d like to use std::shared_ptr whenever possible though. Sadly, there is no direct con[详细]
2023-03-12 04:48 分类:问答tr1::bad_weak_ptr [duplicate]
This question already has answers here: 开发者_开发百科 Closed 11 years ago. Possible Duplicate: enable_shared_from_this - empty internal weak pointer?[详细]
2023-03-12 03:19 分类:问答how can i convert boost::array to boost::shared_ptr
boost::array<uint8_t,1000> buffer; ByteBuffer b((boost::shared_ptr<uint8_t>)buffer.data(), buffer.size());[详细]
2023-03-11 07:20 分类:问答Confusion about Copy-On-Write and shared_ptr
I have searched the web and read through the Boost documentation about shared_ptr.There is a response on SO that says that shared_ptr for Copy-On-Write (COW) suc开发者_如何学JAVAks and that TR! has re[详细]
2023-03-10 07:48 分类:问答No suitable constructor exists to convert from "dumb pointer" to "smart pointer"
struct A { A(int a); }; struct B { B(); void b(std::shared_ptr<A> 开发者_开发技巧a); }; int main()[详细]
2023-03-08 05:33 分类:问答Implicit conversion of vector<shared_ptr<Foo> > to vector<shared_ptr<const Foo> >
According to this page you can implicitly convert shared_ptr<Foo> to shared_ptr<const Foo>. That makes good sense.[详细]
2023-03-07 02:55 分类:问答Safely convert (vector of shared_ptr to objects) to (vector of shared_ptr to constant objects)
class A {}; typedef shared_ptr<const A*> AConstPtr; typedef shared_ptr<A*> APtr; vector<APtr> ptr;[详细]
2023-03-06 14:52 分类:问答boost::factory creating boost::enable_shared_from_this class
I have multiple class derivated from A class A : public boost::enable_shared_from_this<A> { public:[详细]
2023-03-05 15:13 分类:问答Why do std::shared_ptr<void> work
I found some code using std::shared_ptr to perform arbitrary cleanup at shutdown. At first I thought this code could not possibly work, but then I tried the following:[详细]
2023-03-03 03:41 分类:问答Building an Object System Around shared_ptr
I am using shared_ptr as my garbage collection for a toy language that I am working on which compiles to C++. My objects derive from a common base class above that there are strings and numbers then t[详细]
2023-03-02 13:27 分类:问答