I have few questions on the best practices of using shared_ptr. Question 1 Is copying shared_ptr cheap? Or do I need to pass it as reference to my own helper functions and return as value? Something
I have a few containers in a class, for example, vector or map which contain shared_ptr\'s to objects living on the heap.
I\'m currently putting together an application that relies heavily on shared_ptr and everything looks good so far - I\'ve done my homework and have a pretty good idea of some of the pitfalls of using
I\'m writing a game and an accompanying engine in C++. The engine relies heavily on automation using a simple embedded scripting language. Scripts can create object classes, define event listeners on
In my current project I am using boost::shared_ptr quite exten开发者_C百科sively. Recently my fellow team mates have also started using weak_ptr. I don\'t know which one to use and when.
Is there any tips/tricks for finding cyclic references of shared_ptr\'s? This is an exmaple of what I\'m trying to find - unfortunately I can\'t seem to find the loop in my code.
How can one convert a shared_ptr that points to a const object to a shared_ptr that points to a non-const object.
I have a class like this: class Inner; class Cont { public: Cont(); virtual ~Cont(); private: Inner* m_inner;
I\'m having a problem with the following code: #include <list> #include <boost/shared_ptr.hpp>
Consider the following example code: class Foo { }; class Bar : public Foo { }; class FooCollection { protected: