🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Restricting access with access/using declarations

#2063
From: John Lacey
Date: Thu, 28 Sep 1995 17:16
33 lines
1617 bytes
Is the following line of the ARM obsolete?

    An access declaration may not be used to restrict access to a
    member that is accessible in the base class, nor may it be
    used to enable access to a member that is not accessible in
    the base class [ARM, 11.3].

The best thing I found in the WP was the following, and an
example in paragraph 16 of 7.3.3., both of which seem
contradictory to the ARM.

    The base class member is given, in the derived class, the
    access in effect in the derived class declaration at the
    point of the access declaration.

If this was indeed changed, I am curious how the arguments for
the limitation given in the ARM were turned.

Along with this, is there a place where changing access to a
virtual function when it is overridden is explicitly said to be
legal? That is, are the following and its counterparts valid?

class base { public: virtual void vf(); };

class derived: public base { private: void vf(); };

John L

---
[ 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: <MATT.95Sep28101607@physics2.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: John Lacey <johnl@cs.indiana.edu>
Newsgroups: comp.std.c++
Subject: Restricting access with access/using declarations
Date: 28 Sep 1995 17:16:07 GMT
Organization: Computer Science, Indiana University
Approved: matt@physics2.Berkeley.EDU (Matt Austern)
Message-ID: <MATT.95Sep28101607@physics2.Berkeley.EDU>
NNTP-Posting-Host: physics2.berkeley.edu