Topic: Restricting access with access/using declarations
Author: John Lacey <johnl@cs.indiana.edu>
Date: 1995/09/28 Raw View
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. ]