shared-ptr
Working on a solid Command Pattern with shared_ptr
I am trying to implement a very clean Command Pattern in a library. I have the following structure right now (a few parts are still being finished up):[详细]
2023-02-27 21:02 分类:问答C++ dependency injection - by reference or by boost::shared_ptr?
In cases where constructor dependency injection is required, what are the considerations for using injection by re开发者_Go百科ference vs. using boost::shared_ptr?[详细]
2023-02-27 03:18 分类:问答(Ab)using shared_ptr as a reference counter
Recently i thought of a cunning plan(tm :P)) I have to update settings structure in my program(lets say every 15 seconds). Settings structure is used by multiple functions and every of those function[详细]
2023-02-26 14:03 分类:问答std::shared_ptr and double callback
I have some logic where I am using std::shared_ptrs to objects in an inheritance hierarchy. At one point I need to handle these objects depending on their real type, so I am using a double dispatch (i[详细]
2023-02-26 13:16 分类:问答Deletion of pointer to incomplete type and smart pointers
When trying to use an auto_ptr with a type that was declared with forward-declaration, like this: class A;[详细]
2023-02-24 00:37 分类:问答If I want to use std::shared_ptr, which header to include? [duplicate]
This question already has answers here: Where is shared_ptr? 开发者_运维技巧 (4 answers) Closed 9 years ago.[详细]
2023-02-23 11:58 分类:问答pimpl: Avoiding pointer to pointer with pimpl
In this question I asked \"pimpl: shared_ptr or unique_ptr\" I\'ve been convinced that the proper usage of the pimpl idiom is to use a unique_ptr, not a shared_ptr. It should act to the user as if the[详细]
2023-02-23 05:34 分类:问答boost Shared_pointer NULL
I\'m using reset() as a default value for my shared_pointer (equivalent to a NULL). But how do I check if开发者_如何学Python the shared_pointer is NULL?[详细]
2023-02-23 02:42 分类:问答Is there a way to safely delete QList of non-unique pointers to MyObject?
I know this kind of question has been asked to death but I would like to know if there is anyway to do what I stated in the question without using Boost library pointers etc. Basically I have the foll[详细]
2023-02-22 22:18 分类:问答Wrapping std::vector of boost::shared_ptr in SWIG for Python
EDIT: Solved, my mistake; explained in my answer. I have this: std::vector < boost::shared_ptr < Entity > > entities;[详细]
2023-02-22 09:09 分类:问答