I have a problem with inheritance in C++. Here is what I would like to do:

```
class parent
{
   public:
   int a;
};

class son : public parent
{
   public:
   int b;
   operator parent()
   {
      parent p; p.a = a + b;
      return p;
   }
}

void funct(parent a)
{
    cout<<a.a;
}

son s; s.a = 3; s.b = 4;
funct(s);

```

And I would like it to print out 7. Instead, the casting is implicitly done without affecting anything, and 3 is printed out. Could anyone give me an advice on how to do this? Is this even possible?