From -3686756418916889548
X-Google-Thread: f78e5,f6130266038a8c4d
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: stephen.clamage@sun.com (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: Private Methodes declared outside of the class
Date: Thu, 19 Aug 2004 01:30:44 GMT
Organization: Sun Microsystems, Inc.
Lines: 26
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <cfvuts$sen$1@news1nwk.SFbay.Sun.COM>
References: <2oblfaF8nds3U1@uni-berlin.de>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1092879050 6936 158.152.254.254 (19 Aug 2004 01:30:50 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 19 Aug 2004 01:30:50 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20040414
X-Spam-Checker-Version: SpamAssassin 2.60-mulga_r1 (1.212-2003-09-23-exp) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=-3.5 required=5.2 tests=AWL,BAYES_00 autolearn=ham 
	version=2.60-mulga_r1
X-Accept-Language: en-US, en
X-Path: comp-std-cpp-robomod!not-for-mail
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i7J1UiwK009950;
	Thu, 19 Aug 2004 11:30:44 +1000 (EST)
X-NNTP-Posting-Date: Wed, 18 Aug 2004 16:08:28 +0000 (UTC)
X-Spam-Level: 
X-Delivered-To: std-c++@ucar.edu
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:1820

Ben Strasser wrote:
> 
> I was wondering why you can not declare private methods outside of the 
> class declaration?

If you could declare member functions outside the class definition, 
anyone could hijack the class (for good or bad purposes), or break the 
class invariants without anyone knowing.

The existing rule means that the entire class interface is visible in 
the class declaration, and you have a complete list of everything 
(members and friends) that could be affected by an internal 
implementation change.

This rule works against information hiding, but that was not a design 
goal of C++ classes.

---
Steve Clamage, stephen.clamage@sun.com

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



