Topic: using declarations in derived class


Author: Jens Kilian <Jens_Kilian@agilent.com>
Date: 2000/03/01
Raw View
firstian@nospam.bellatlantic.net (Joe Chan) writes:
> I have a question about using declarations. In the good old days before
> using declarations, there is such a thing called access declarations
> that can be used in a derived class to adjust access to base class
> names. In ARM, the rule states that access declarations cannot be used
> to restrict access to a member that is accessible in the base class.
> Does this rule still apply to using declarations? I looked in the
> standard and couldn't find the section that discuss it. If this rule no
> longer applies, what is the rationale for it, since client code can
> always cast the derived class ptr to a base class ptr and access the
> member.

That is *exactly* the rationale for disallowing an access declaration which
restricts access to a member.  It wouldn't work.

--
mailto:jjk@acm.org                 phone:+49-7031-464-7698 (HP TELNET 778-7698)
  http://www.bawue.de/~jjk/          fax:+49-7031-464-7351
PGP:       06 04 1C 35 7B DC 1F 26 As the air to a bird, or the sea to a fish,
0x555DA8B5 BB A2 F0 66 77 75 E1 08 so is contempt to the contemptible. [Blake]

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: firstian@nospam.bellatlantic.net (Joe Chan)
Date: 2000/02/29
Raw View
Hi all,

I have a question about using declarations. In the good old days before
using declarations, there is such a thing called access declarations
that can be used in a derived class to adjust access to base class
names. In ARM, the rule states that access declarations cannot be used
to restrict access to a member that is accessible in the base class.
Does this rule still apply to using declarations? I looked in the
standard and couldn't find the section that discuss it. If this rule no
longer applies, what is the rationale for it, since client code can
always cast the derived class ptr to a base class ptr and access the
member.

--
Joe Chan

Remove "nospam" to get my address.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]