面向对象+继承可以帮助你。我认为您的意思是这种结构:
class Person
{};
class Father : public Person
{};
class Mother : public Person
{};
class Child : public Father, public Mother
{};
class Son : public Child
{};
class Daughter: public Child
{};
class Family
{
Father father;
Mother mother;
std::vector<Child> children;
};
+------------------+
| Person |
+------------------+
^ ^
| |
| |
\ \
+------------------+ +------------------+
| Father | | Mother |
+------------------+ +------------------+
^ ^
| |
| |
| |
\ \
+------------------+
| Child |
+------------------+
^ ^
| |
| |
\ \
+------------------+ +------------------+
| Son | | Daughter |
+------------------+ +------------------+