shared-ptr
References to boost::smart_ptr pointed to object and checking their validity
Given the following: class Curve { public: typedef boost::shared_ptr<Curve> Pointer; // ... private:[详细]
2023-03-15 20:55 分类:问答Pimpl idiom and internal object collaboration without friend declaration
I\'m implementing several classes using the pimpl idiom and am coming across some design issues. Firstly, I\'ve always seen pimpl done like this[详细]
2023-03-15 15:58 分类:问答Convert this pointer to boost::shared_ptr?
I am having a base class and i want to convert its this pointer to its derived class shared_ptr. I can`t use inheriting enable_shared_from_this in my case. So is there any other efficient way around?[详细]
2023-03-15 13:47 分类:问答Which is faster on Visual C++ 2010 - std::shared_ptr or boost::shared_ptr?
Has anyo开发者_StackOverflow社区ne tested this in release mode builds? Or are the implementations so similar there\'s no significant difference?[详细]
2023-03-15 11:10 分类:问答`shared_ptr` breaks constness of the object
Consider the following code: class B { int x; public: B() : x( 10 ) {} int get_x() const { return x; } void set_x( int value ) { x = value; }[详细]
2023-03-14 19:28 分类:问答shared data between objects via a pointer in C++
I have several objects which share a data via a pointer. The pointer parameter was sent via in the constructor functions, as follows.[详细]
2023-03-14 17:34 分类:问答C++: shared_ptr as unordered_set's key
Consider the following code #include <boost/unordered_set.hpp> #include <boos开发者_开发问答t/shared_ptr.hpp>[详细]
2023-03-14 10:46 分类:问答C++ Sharing elements in a boost::ptr_container?
Please consider the following piece of code: int main() { typedef boost::ptr_vector<int> ptr_vector;[详细]
2023-03-13 14:38 分类:问答Where is the std equivalent of boost::shared_polymorphic_downcast in C++11?
boost::shared_polymorphic_downcast and the other boost::shared_ptr functions reside in <boost/shared_ptr开发者_StackOverflow中文版.hpp>[详细]
2023-03-12 20:55 分类:问答Should I switch from using boost::shared_ptr to std::shared_ptr?
I would like to enable support for C++0x in GCC with -std=c++0x. I don\'t absolutely necessarily need any of the currently supported C++11 features in GCC 4.5 (and soon 4.6), but I would like to start[详细]
2023-03-12 13:55 分类:问答