I have a class manipulating only shared_ptr to an inheritance hierarchy (quite simple, there are a few classes, say A, B, C etc. inheriting from a single class Base). Since I do not need to manipulate
I currently have this: #define THIS(T) (boost::static_pointer_cast<T>(shared_from_this())) The macro is used in a method like this:
void ClassName::LocalMethod( ) { boost::shared_ptr<ClassName> classNamePtr( this开发者_如何学Python );
I am using boost::shared_ptr to organize my pointer data in my game engine. I tried to make a very short example to show my problem:
I\'m trying to implement an MVP pattern using STL and I have used *shared_ptr* and *weak_ptr* for \"breaking the cycle\" when having recurrent references.
I\'m writing an extension module for Python in C++ and I am using boost.python. I want to expose a function that returns a vector<MyClass>. I\'m not exactly sure how to do this and how it will i
I have an std::vector of objects and i cycle it calling some methods of the object. One of them will check a particular condition and if needed will delete itsef from the vector. The point is that era
In C++, I can write something like: shared_ptr<A> a_sp = someFunctionReturningSharedPtr(); if (a_sp) {
I have a class which contains a BYTE*, a reference counter and a CRITICAL_SECTION which protects both of them from concurrent access.
I\'m quite new to C++ and I have written the class and function below: class Person { public: boost::shared_ptr<Details> GetDetails(const std::string& name) const;