From 8283172322218700051
X-Google-Thread: f78e5,6f042a6ff823c6a0
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.phibee.net!news.clara.net!wagner.news.clara.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: austern@well.com (Matt Austern)
Newsgroups: comp.std.c++
Subject: Re: Relation of enermy(anti-friend)
Date: Mon, 30 Aug 2004 05:36:34 GMT
Organization: dis
Lines: 29
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <m2llfxwem7.fsf@Matt-Austerns-Computer.local>
References: <cgk8od$vai$1@news.kreonet.re.kr>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: news.demon.co.uk 1093844197 4292 158.152.254.254 (30 Aug 2004 05:36:37 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 30 Aug 2004 05:36:37 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50
X-Spam-Checker-Version: SpamAssassin 2.64-mulga_r1 (2004-01-11) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
	version=2.64-mulga_r1
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i7U5aYln020636;
	Mon, 30 Aug 2004 15:36:34 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-NNTP-Posting-Date: Mon, 30 Aug 2004 02:20:48 +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++:2309

stkim@yujinrobot.com ("Kim, Seungtai") writes:

> May be it just funny question.
> 
> The friend makes that a function or class can access to
> invisible memebers with particular right. It works well for
> operator <<, >>, etc.
> 
> In this point, the question arises. Why there is no enemy relation.

Bottom line: because it has yet to be shown to be useful.  

C++'s protection mechanism (public/private/protected, with friendship)
obviously isn't the most general way to handle things.  Other
languages have different mechanisms, and at least one language,
Eiffel, has one that's much more general.  In C++ there's no good way
for a class to grant access to a single private member function
without granting access to all private members, but in Eiffel it's
easy.  But my (now rather old) experience with Eiffel is that this
feature is rarely used in its full generality.  Most new languages
stick with something like C++'s categories, because, coarse as they
are, they're the categories that turn out to be used in real programs.

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



