
Am Thursday 22 October 2009 18:24:14 schrieb Ireneusz Szpilewski:
But we were to do a transplant in C++. I'll try my best, I set up my classes:
class MyHeart: public rtti_base, // can do dynamic_cast public Heart, // it is human heart public MySongSinger // it can SingMySong() { // };
class Me: public rtti_base, // can do dynamic_cast public Human // I am a Human, hospital can do Human->SwapHearts(Heart* newheart); { //... rtti_base* heart; // initialized to new MyHeart };
I am ready and waiting in the hospital for a dead person heart. BANG!!! Fortunately (for me) there was a car accident and we have 2 bodies:
Joe dead_joe; AlienHumanoid dead_alien;
What to do next?
could you plase move this to comp.lang.c++ or a similar place?