home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c++:15917 comp.std.c++:1512
- Newsgroups: comp.lang.c++,comp.std.c++
- Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: PROPOSAL: Hidden private parts of classes
- Message-ID: <1992Nov7.154613.22811@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <1992Oct30.113234.15010@daimi.aau.dk> <klamer.720475994@mi.el.utwente.nl>
- Date: Sat, 7 Nov 1992 15:46:13 GMT
- Lines: 28
-
- In article <klamer.720475994@mi.el.utwente.nl> klamer@mi.el.utwente.nl (Klamer Schutte) writes:
- >In <1992Oct30.113234.15010@daimi.aau.dk> sabroe@daimi.aau.dk (Morten Sabroe Mortensen) writes:
- >
- >> Lately I've coded a lot of small libraries in C++, and been
- >>thinking, why it's not possible to hide private parts, -it doesn't
-
- >The compiler does not know what the data layout will be of the object.
- >So the best he can do, is make a reference to the actual data.
- >
- >This means that the actual class will be just a pointer to the real data:
-
- No, when USING the interface the compiler doesnt need to
- know about the private parts, it needs to know only the size of
- the object to allocate storage for it.
-
- This can be done using external reference to the size,
- or as I have seen done in a Modula compiler in which the
- implementation has been compiler, the compiler looks up the
- last size, uses that, and if it gets changed automatically
- recompiles the module. This requires environment support that
- C++ doesnt have though, but it can be done---without pointers.
-
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-