Listing 1: Code to illustrate the lookup rules for allocation functions

void *operator new(size_t) throw (bad_alloc);

class B
    {
public:
    void *operator new(size_t) throw (bad_alloc);
    ...
    };

class X
    {
public:
    void f();
    void *operator new(size_t) throw (bad_alloc);
    ...
    class D : public B
        {
        ...
        };
    };

void X::f()
    {
    ...
    // calls B::operator new(size_t)
    D *pd = new D;
    ...
    }
/* End of File */