Thread View: comp.std.c++
1 messages
1 total messages
Started by Sanjay Pujare
Fri, 15 Dec 1995 03:44
Calling qualified member functions: a question
Author: Sanjay Pujare
Date: Fri, 15 Dec 1995 03:44
Date: Fri, 15 Dec 1995 03:44
43 lines
1544 bytes
1544 bytes
Hi nettors,
I would like to know if the following program is legal or not:
//------------------------------------------------------
class X {
~X() { ... }
};
class A {
class X : public ::X {
~X() { ... }
};
void foo() {
X o1;
o1.::X::~X(); // we want the dtor for the first X to
// be called, how else to specify that?
}
};
According to the April ANSI C++ draft the construct o1.::X::~X() seems
illegal because
postfix-expression:
:
postfix-expression . id-expression
And id-expression cannot start with '::' .
If that is the case, should the standard be modified to allow this
kind of construct?
Regards,
Sanjay (sanjayp@cup.hp.com)
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
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