shared-ptr
Who owns memory returned by MySQL Connector C++?
I\'m having memory leak / deleting errors when using MySQL Connector C++ 1.05. The Connector returns a pointer to a result set from executing query.[详细]
2023-02-15 08:06 分类:问答questions regarding shared_from_this
I have a function which takes a shared_ptr<MyClass>. In some member function memfun of MyClass, I need to pass this t开发者_如何转开发o that function. But if I write[详细]
2023-02-15 07:27 分类:问答Mixing C and C++, raw pointers and (boost) shared pointers
I am working in C++ with some legacy C code. I have a data structure that (during initialisation), makes a copy of the structure pointed to a ptr passed to its initialisation pointer.[详细]
2023-02-15 02:53 分类:问答Threading a Shared Model with pointers
I have a vector of pointers to objects created with new. Multiple threads access this vector 开发者_高级运维in a safe manner with various gets/sets. However, a thread may delete one of the objects, in[详细]
2023-02-15 02:48 分类:问答Dynamically allocate image in a shared_ptr each frame
I\'m trying to use shared_ptr for the first time here, but I\'m having some trouble doing this. I want to get am IplImage every frame and allocate to a shared_ptr class member, releasing the last im[详细]
2023-02-14 18:35 分类:问答boost::shared_ptr and assigning derived classes
Assume DerivedClass is derived from BaseClass Would the following work? boost::shared_ptr<BaseClass> a(new 开发者_开发百科BaseClass());[详细]
2023-02-13 13:41 分类:问答How can I pass boost::shared_ptr as a pointer to a Windows Thread function?
How can I pas开发者_JS百科s boost::shared_ptr as a pointer to a Windows Thread function ? assume following code :[详细]
2023-02-13 07:02 分类:问答boost::shared_?? for non-pointer resources
Basically i need to do reference counting on certain resources (like an integer index) that are not inmediately equivalent to a pointer/address semantic; basically i need to pass开发者_开发百科 around[详细]
2023-02-12 00:10 分类:问答shared_ptr and weak_ptr differences
I am reading Scott Meyers \"Effective C++\" book. It was mentioned that there are tr1::shared_ptr and tr1::weak_ptr act like built-in pointers, but they keep track of how many tr1::shared_ptrs point t[详细]
2023-02-10 00:51 分类:问答boost::shared_ptr, std::map and valgrind - Do I have a memory leak?
Alright. I am using boost::shared_ptr to store a couple of objects in a map. Integer values maps to shared_ptrs to objects that I am using.[详细]
2023-02-08 12:50 分类:问答