Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!cep From: cep@Apple.COM (Christopher Pettus) Newsgroups: comp.lang.c++ Subject: Re: Public vs Private header files in C++ Message-ID: <53598@apple.Apple.COM> Date: 3 Jun 91 22:22:50 GMT References: <5243@servax0.essex.ac.uk> <1991Jun3.182909.21539@agate.berkeley.edu> <5tdHm72m@cs.psu.edu> Organization: Apple Computer, Inc. Lines: 23 In article <5tdHm72m@cs.psu.edu> schwartz@groucho.cs.psu.edu (Scott Schwartz) writes: > >jbuck@forney.berkeley.edu (Joe Buck) writes: > Stroustrup said something about this: the member access system is designed > to protect against accidents, not maliciousness. > >An then on page 253 gives an example of language features designed to >prevent maliciousness (noninheritance of friendship), using an example >named "class Spy". Stroustrup's choice of words in this example is exceptionally poor, but the issue is the same: it would be easy to violate the purpose of protected and private if friendship was inherited (at least that's his point; IMHO, it's being overly conservative). The _real_ reason is, of course, the same: without full compiler access to the class definition, it's size could not be determined, which violates the classes-as-primitive-types goal of C++ (which is a worthy one). -- Christopher Pettus -- Object-Based Systems -- Apple Computer, Inc. MS 3-PK -- (408) 974-0004 -- cep@apple.com -- Link CHRISTOPHE "Don't let your .h write no check that your .c can't cash."