I'd like some input on the way I've structured some things in a side-project I'm working on.I declare an abstract class, CelestialObj, which will contain the common elements between Planets, and Moons (both of which I'd like to be derived from CelestialObj, obviously).Now, a Planet must keep track of its Moon objects. Therefore, each of my Planet objects will contain a vector<Moon*> stack. I was wondering if this is bad practice or can cause me trouble later down the line? I can't really find much information regarding this issue on various forums/google searches. Here's a SCCCE version of the code:class CelestialObj {protected:    int size;    //virtual function definitions here, imaging they're in Moon/Planet too};class Moon : public CelestialObj {public:    int distFromPlanet;    Moon() : distFromPlanet(10), size(1000) { }};class Planet : public CelestialObj {public:    vector<Moon> moons;    Planet() : size(2000) { Moon mun; moons.push_back(mun); }};The actual code is much more organized, with members declared protected/private where appropriate, but this conveys the intended logic.Is there anything that stands out as dangerous? Or that should be avoided? Minor things such as size being const, and public/private/protected declarations should not be discussed, as they're fine in my actual code. It's just the organization I'm kind of worried about. Is there an alternate organization method anyone recommends? If so, why?
Cons of declaring derived class type member in another derived class (both of which share the same base class)
c++;inheritance