Path: utzoo!utgpu!water!watmath!clyde!att!ucbvax!decwrl!labrea!polya!shap From: shap@polya.Stanford.EDU (Jonathan S. Shapiro) Newsgroups: comp.lang.c++ Subject: Re: Can we hide the private part of a class ? Keywords: header dependency, efficiency. Message-ID: <4223@polya.Stanford.EDU> Date: 3 Oct 88 01:24:16 GMT References: <1358@stratus> <1988Sep29.044111.16104@utzoo.uucp> <4193@polya.Stanford.EDU> <1368@cumulus> Reply-To: shap@polya.Stanford.EDU (Jonathan S. Shapiro) Organization: Stanford University Lines: 18 In article <1368@cumulus> hsu@cumulus.UUCP (Yung-Kao Hsu) writes: >--------- > >In article <1988Sep29.044111.16104@utzoo.uucp> henry@utzoo.uucp >(Henry Spencer) writes: > >>The user can't access x, so seeing it won't do him much good. However, > >This is true if all public functions won't return any pointer to x. >But, sometimes for efficiency reason, we will allow such bad pratice. The fact that a programmer can willfully break the type system is not a good argument here. I can also use integer pointers as character pointers. If the function returning pointer wants to be type-safe, it should be declared as returning a pointer to a class member. In that case, what Henry says continues to be true. Jon