Advertisement
TwITe

Untitled

Dec 21st, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Base {
  5. public:
  6.     virtual void function1() {};
  7.  
  8.     virtual void function2() {};
  9. };
  10.  
  11. class A : public Base {
  12.     void function1() override {};
  13. };
  14.  
  15. class B : public Base {
  16.     void function2() override {};
  17. };
  18.  
  19. Virtual table for Base {
  20.     function1() = Base::function1();
  21.     function2() = Base::function1();
  22. };
  23.  
  24. Virtual table for A {
  25. function1() = A::function1();
  26. function2() = Base::function1();
  27. };
  28.  
  29. Virtual table for B {
  30. function1() = Base::function1();
  31. function2() = B::function1();
  32. };
  33.  
  34. int main() {
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement