🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1483

Calling qualified member functions: a question

#1483
From: Sanjay Pujare
Date: Fri, 15 Dec 1995 03:44
43 lines
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. ]
Technical Details
Message-ID: <SANJAYP.95Dec14175902@hpcll169.cup.hp.com>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: sanjayp@hpcll169.cup.hp.com (Sanjay Pujare)
Newsgroups: comp.std.c++,comp.lang.c++
Subject: Calling qualified member functions: a question
Date: 15 Dec 1995 03:44:40 GMT
Organization: Hewlett Packard Cupertino Site
Approved: clamage@eng.sun.com (comp.std.c++)
Distribution: world
Message-ID: <SANJAYP.95Dec14175902@hpcll169.cup.hp.com>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: hpcll169.cup.hp.com
Content-Length: 738
Originator: clamage@taumet