TITLE: Dominance is determined by function name


[ This example adapted from "C++ Gotchas", tutorial notes
  copyright by Tom Cargill, p. 75 ]


#include <iostream.h>


class Top {
  public:
    void f (int);
    void f (double);
};


class Left : public virtual Top {
};


class Right : public virtual Top {
  public:
    void f (int);
};

void Right :: f (int) { cout << "Right::f" << endl; }


class Bottom : public Left, public Right {
};


int main ()
{
    Bottom b;
    b.f (123.123);

    return 0;
}


This program outputs the following.

Right::f

For more information see the ARM p. 205.
