home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / cplus / 2012 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.8 KB  |  40 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!gatech!swrinde!sdd.hp.com!usc!news.service.uci.edu!network.ucsd.edu!qualcom.qualcomm.com!harvey.qualcomm.com!greg
  3. From: greg@harvey.qualcomm.com (Greg Noel)
  4. Subject: Re: Proposal for default scope
  5. Message-ID: <1993Jan8.225829.16481@qualcomm.com>
  6. Sender: news@qualcomm.com
  7. Nntp-Posting-Host: harvey.qualcomm.com
  8. Organization: Qualcomm, Inc., San Diego, CA
  9. References: <1993Jan8.173654.1189@cci632.cci.com>
  10. Date: Fri, 8 Jan 1993 22:58:29 GMT
  11. Lines: 27
  12.  
  13. Donald W. Rouse II <dwr@cci632.cci.com> writes:
  14. >You can accomplish the same thing with
  15. >    class Class {
  16. >    private: static int helper ();
  17. >    public:  int func1();
  18. >    };
  19. >although you don't get the syntactic sugar.
  20.  
  21. You miss my point.  I specifically want to be able to use a type-safe
  22. helper function that _isn't_mentioned_in_the_class_header_.  That is, the
  23. function is _not_ part of the interface, it's part of the implementation.  A
  24. helper function in the class header is visible, even if it is not accessible,
  25. and can cause an ambiguity under derivation.
  26.  
  27. Another way of saying this is that there's no reason to declare names that
  28. are part of the implementation in the class header.  If the implementation
  29. is changed, helper functions may be added, changed, or dropped, but as long
  30. as the _interface_ is unchanged, clients of the interface shouldn't need to
  31. be changed.
  32.  
  33. It also permits multiple implementations of the same interface, which you
  34. could select among based on whatever criteria you wished: speed of operation,
  35. space efficiency, precision of result, freedom from bugs, NIH, ....  If the
  36. implementation functions are fixed as part of the interface, this is not
  37. always possible.
  38. -- 
  39. -- Greg Noel, Unix Guru         greg@qualcomm.com  or  greg@noel.cts.com
  40.