From 5680126314246762187
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: SeeWebsiteForEmail@moderncppdesign.com ("Andrei Alexandrescu (See Website for Email)")
Newsgroups: comp.std.c++
Subject: Re: Private Methodes declared outside of the class
Date: Sun, 22 Aug 2004 05:16:23 GMT
Lines: 40
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <2opeorFcvfp8U1@uni-berlin.de>
References: <2oblfaF8nds3U1@uni-berlin.de> <cfvuts$sen$1@news1nwk.SFbay.Sun.COM> <2oih41Fb5pb5U1@uni-berlin.de> <8b42afac.0408200500.48e13c94@posting.google.com>
NNTP-Posting-Host: news.news.demon.net
X-Trace: news.demon.co.uk 1093151787 22383 158.152.254.254 (22 Aug 2004 05:16:27 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sun, 22 Aug 2004 05:16:27 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-Priority: 3
X-Spam-Checker-Version: SpamAssassin 2.64-mulga_r1 (2004-01-11) on 
	mulga.cs.mu.OZ.AU
X-Orig-X-Trace: news.uni-berlin.de tCcwaUvaKVeuS9UpfKD39AhJTyJZYno4G7K0bgvV+Q9Jr3I4A=
X-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,PRIORITY_NO_NAME 
	autolearn=no version=2.64-mulga_r1
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i7M5GNt1014982;
	Sun, 22 Aug 2004 15:16:23 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Spam-Level: 
X-Delivered-To: std-c++@ucar.edu
X-Spamscanner: mailbox2.ucsd.edu  (v1.4 May 20 2004 13:55:33, 0.7/5.0 2.63)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-Newsgroups: comp.std.c++
X-MailScanner: PASSED (v1.2.8 73403 i7LHNe7f075128 mailbox2.ucsd.edu)
Xref: g2news1.google.com comp.std.c++:2009

"James Kuyper" <kuyper@wizard.net> wrote in message 
news:8b42afac.0408200500.48e13c94@posting.google.com...
> SeeWebsiteForEmail@moderncppdesign.com ("Andrei Alexandrescu (See Website 
> for Email)") wrote in message news:<2oih41Fb5pb5U1@uni-berlin.de>...
>> "Steve Clamage" <stephen.clamage@sun.com> wrote in message
>> news:cfvuts$sen$1@news1nwk.SFbay.Sun.COM...
>>
>>> 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.
>>
>> Well, not if they don't have access to the class' private parts. (I 
>> understand this is derailing the discussion from OP's post.)
>
> Then they don't need to be member functions (or even friends).

Very true. However, many a programmer prefers obj.Foo() to Foo(obj), to make 
it clear who the "main receiver" is.

A good language would allow both syntaxes making them equivalent (that's 
what Cecil does).

(derailing the discussion further...)


Andrei


---
[ 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                       ]



