🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Paul N. Hilfinger Tue, 26 Jan 1993 01:29
Member function overloading
#1410
Author: Paul N. Hilfinger
Date: Tue, 26 Jan 1993 01:29
23 lines
994 bytes
In at least versions 1.39, 2.2.2, and 2.3.3 of g++/gcc (for the Sun),
the attached program compiles without comment.  My understanding is
that, on the contrary, the definition of I::f should hide, rather than
overload, that of H::f, making the calls f() and x.f() illegal.

P. Hilfinger

---------------------------- cut here ---------------------------
class H {
public:
    int f();
};

class I : public H {
public:
    int f(double) { return f(); }
};

int main()
{
    I x;
    return x.f();
}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads