With shared_ptr included in c++11, one could achieve a semi garbage-collected enviroment. Does the (inflationary?) usage come along with some disadvantages?
I could imagine a class model, where you create a class in which you typedef your class at the end as a shared_ptr to abbreviate the syntax.
/////////////////
//// MyClass ////
/////////////////
#include <memory>
class MyClass {
public:
Myclass();
};
typedef std::shared_ptr<MyClass> SharedMyClass;
///////////////////////
//// Example Class ////
///////////////////////
class Example {
public:
Example(): myClassObject(new MyClass()) {}
private:
SharedMyClass myClassObject;
};