home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 15917 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1.9 KB

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