Topic: [basic.lookup.classref] par. 3 example: er
Author: Stephen.Clamage@Eng.Sun.COM (Steve Clamage)
Date: 1997/02/26 Raw View
In article 2584956@news.cis.ohio-state.edu, sergey@cis.ohio-state.edu (Sergey Zhupanov) writes:
>
>In the example in Draft Standard Dec. 2, 1996, page 3-19, the example
>on top of the page:
>
>The line that reads:
> e.B::a = 0; // ok, only one A:a in E
>
>since B is defined as:
> struct B: virtual A { };
>
>isn't A::a private in B, and therefore inaccessible in e?
The default access for structs is public, although it is private for
classes. (That is the only difference between the struct and class keywords.)
'A' is a struct, so its member 'a' has public access. B is a struct,
so its derivation from A is public as well.
The example is OK.
---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]