Path: utzoo!utgpu!water!watmath!clyde!att!ulysses!hector!ekrell From: ekrell@hector.UUCP (Eduardo Krell) Newsgroups: comp.lang.c++ Subject: Re: Can we hide the private part of a class ? Keywords: header dependency, efficiency. Message-ID: <10687@ulysses.homer.nj.att.com> Date: 3 Oct 88 20:46:02 GMT References: <1368@cumulus> <10681@ulysses.homer.nj.att.com> <1369@cumulus> Sender: netnews@ulysses.homer.nj.att.com Reply-To: ekrell@hector.UUCP (Eduardo Krell) Organization: AT&T Bell Laboratories Lines: 22 In article <1369@cumulus> hsu@cumulus.UUCP (Yung-Kao Hsu) writes: >The problem you mentioned above really only hit half of the target. If the >sizeof() was used, the data type involved really is not private as far as >I can see. I didn't explain myself. I meant to say that anytime the size of the class is needed (e.g., when you generate an instance of the class), that module will have to be recompiled. You don't have to use sizeof() directly, but the compiler will need it to generate the right argument for malloc() when you create an object of that class. And there's more. You can move members around and add/remove private members. That could change the relative offsets of members in the class. A program that was using object->member now needs to be recompiled because the offset of "member" might have changed... Eduardo Krell AT&T Bell Laboratories, Murray Hill, NJ UUCP: {att,decvax,ucbvax}!ulysses!ekrell Internet: ekrell@ulysses.att.com