Assume I have this header:
#include <vector>
class B;
class A
{
...
private:
std::vector<what_pointer B> holder;
};
I don't want to include B in the header so I made the "class B" forward reference to it. However the header has that container for B's, and since B's true header is only included in the Cpp, I must use pointers to B inside the container.
Obviously I could create a destructor for A which goes through the "holder" and de allocates all the memory areas the pointers are pointing to. But I'm wondering if there is a smart pointer that "should" be used in this situation instead of a raw pointers.