Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Public vs Private header files in C++ Message-ID: <757@taumet.com> Date: 4 Jun 91 15:39:22 GMT Article-I.D.: taumet.757 References: <5243@servax0.essex.ac.uk> <1991Jun3.182909.21539@agate.berkeley.edu> <5tdHm72m@cs.psu.edu> <53598@apple.Apple.COM> Organization: Taumetric Corporation, San Diego Lines: 18 cep@Apple.COM (Christopher Pettus) writes: >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). The compiler needs to know more than the class size. The offset of a public data member depends on all previous data members, and the index of a public virtual function depends on all previous virtual functions. So code which references only public members of a class in general still needs to include a complete class declaration. One can argue about the merits of this feature of C++ language design, but partial class definitions are nevertheless not allowed. -- Steve Clamage, TauMetric Corp, steve@taumet.com