smart-pointers
safe_ptr implementation
I\'m trying to implement a safe version of std::shared_ptr, called \"safe_ptr\" which guarantees \"non-nullness\".[详细]
2023-01-30 02:53 分类:问答allocate shared_ptr in a function
I need to create a function that returns an allocated shared_ptr variable. is this the correct way? typedef boost::shared_ptr<std::vector<char> > sharePtr;[详细]
2023-01-29 01:35 分类:问答The explicit keyword in MS Visual Studio 4.1
I am implementing a smart pointer class using generics and I wanted to force users of this class to properly construct the smart pointer using syntax such as[详细]
2023-01-27 11:32 分类:问答Pass a container of smart pointer as argument in C++
I have a function like below void functionA(unordered_map<string, classA*>* arg1); I need to pass in[详细]
2023-01-27 01:38 分类:问答Reference counted smart pointer that deletes owned object with ref count greater than zero?
I have a design where objects are simultaneously owned by 2 queues. Occasionally the queues themselves may be deleted. In this case, all objects in the queue must be deleted and removed from the other[详细]
2023-01-24 02:57 分类:问答Is this C++ pointer container safe?
I want a safe C++ pointer container similar to boost\'s scoped_ptr, but with value-like copy semantics.I intend to use this for a very-rarely used element of very-heavily used class in the innermost l[详细]
2023-01-23 14:59 分类:问答Convert a raw pointer to a clone_ptr
I have a clone_ptr implementation, as was shown in this question and I have a problem where I need to create a clone_ptr from a ra开发者_如何学Gow pointer returned from a function.[详细]
2023-01-23 11:05 分类:问答clone_ptr problem, I need to create a copy object using a function of the library instead of new
I am a bit new to templates in C++ so forgive me if this question is confusing or stupid, I just have a problem where I want to implement a clone smart pointer so I don\'t have to create copy construc[详细]
2023-01-22 22:11 分类:问答Library function returns raw pointer and I want to use smart pointer
I have this situation where the library I use has many functions that return raw pointers to objects, how could I now use boost smart pointers in my program using this library and using smart pointers[详细]
2023-01-21 09:02 分类:问答C++ smart pointer to statically and dynamically allocated resource
my base class need to expose a method that for some derived classes would return a smart pointer to dynamically allocated array, and for some other derived classes would return a pointer/reference to[详细]
2023-01-21 02:02 分类:问答