home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c++
- 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
- From: greg@harvey.qualcomm.com (Greg Noel)
- Subject: Re: Proposal for default scope
- Message-ID: <1993Jan8.225829.16481@qualcomm.com>
- Sender: news@qualcomm.com
- Nntp-Posting-Host: harvey.qualcomm.com
- Organization: Qualcomm, Inc., San Diego, CA
- References: <1993Jan8.173654.1189@cci632.cci.com>
- Date: Fri, 8 Jan 1993 22:58:29 GMT
- Lines: 27
-
- Donald W. Rouse II <dwr@cci632.cci.com> writes:
- >You can accomplish the same thing with
- > class Class {
- > private: static int helper ();
- > public: int func1();
- > };
- >although you don't get the syntactic sugar.
-
- You miss my point. I specifically want to be able to use a type-safe
- helper function that _isn't_mentioned_in_the_class_header_. That is, the
- function is _not_ part of the interface, it's part of the implementation. A
- helper function in the class header is visible, even if it is not accessible,
- and can cause an ambiguity under derivation.
-
- Another way of saying this is that there's no reason to declare names that
- are part of the implementation in the class header. If the implementation
- is changed, helper functions may be added, changed, or dropped, but as long
- as the _interface_ is unchanged, clients of the interface shouldn't need to
- be changed.
-
- It also permits multiple implementations of the same interface, which you
- could select among based on whatever criteria you wished: speed of operation,
- space efficiency, precision of result, freedom from bugs, NIH, .... If the
- implementation functions are fixed as part of the interface, this is not
- always possible.
- --
- -- Greg Noel, Unix Guru greg@qualcomm.com or greg@noel.cts.com
-