Slimelite BBS

VIRTUAL BASE CLASSES

Back to EMULATE

From Walt Karas · 1996-04-04 10:55 · #73623 in EMULATE

MB> WK> Polymorphism is not possible in C++ without casting,

MB>That's news to me.

void foo(A);

class A
  {
  };

class B : public A
  {
  };

B b;
foo(b);      // 1
foo((A) b);  // 2

Don't 1 and 2 do the same thing?  Why don't you want to call what
is happening in # 1 a cast?
---
 þ SLMR 2.1a þ 
                                                                            

--- Simplex BBS (v1.07.00Beta [DOS])
 * Origin: To hell with the prime directive, FIRE! (1:151/117)