G
Guest
I have a series of objects of class A, some of this objects (depending on
the program execution) will need to create an object of class B (but only
one shared instance of B is needed). How would you implement this? If I had
a static pointer to B as a member of A, how to check if it is already
allocated? When to release its memory?
the program execution) will need to create an object of class B (but only
one shared instance of B is needed). How would you implement this? If I had
a static pointer to B as a member of A, how to check if it is already
allocated? When to release its memory?