Original Post
Hi, I was wondering if the keyword "this" is dynamically or statically allocated. The reason why I ask is I need to store pointer of a class object inside another class object and I was trying to avoid using a raw pointer to store it. For exampleSo I though I might use a boost::shared_ptr. The confusion comes with the fact that boost::share_ptr is looking for a dynamically allocated object and am wondering what my options are. Regards Chad
class A
{
B b;
void Init()
{
b.SetA(this);
}
}
class B
{
void SetA(A* aPointer){a = aPointer};
A* a;
}