From 4674125883644858282
X-Google-Thread: f78e5,6f042a6ff823c6a0
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news2.google.com!proxad.net!news.cs.univ-paris8.fr!news.zanker.org!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: nagle@animats.com (John Nagle)
Newsgroups: comp.std.c++
Subject: Re: Relation of enermy(anti-friend)
Date: Fri, 27 Aug 2004 02:40:26 GMT
Organization: SBC http://yahoo.sbc.com
Lines: 36
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <5QrXc.11946$OX3.7394@newssvr27.news.prodigy.com>
References: <cgk8od$vai$1@news.kreonet.re.kr> <tXqXc.319$Ae.239@newsread1.dllstx09.us.to.verio.net>
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 1093574430 23626 158.152.254.254 (27 Aug 2004 02:40:30 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Fri, 27 Aug 2004 02:40:30 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113
X-Spam-Checker-Version: SpamAssassin 2.64-mulga_r1 (2004-01-11) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
	version=2.64-mulga_r1
X-Accept-Language: en-us, en, ja
X-UserInfo1: SCSYQNONTRUARPLYZZODM^P@VZ\LPCXLLBWLOOAFEQR@ETUCCNSKQFCY@TXDX_WHSVB]ZEJLSNY\^J[CUVSA_QLFC^RQHUPH[P[NRWCCMLSNPOD_ESALHUK@TDFUZHBLJ\XGKL^NXA\EVHSP[D_C^B_^JCX^W]CHBAX]POG@SSAZQ\LE[DCNMUPG_VSC@VJM
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 i7R2eQ19024369;
	Fri, 27 Aug 2004 12:40:26 +1000 (EST)
X-NNTP-Posting-Date: Thu, 26 Aug 2004 16:35:13 EDT
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++:2224

Victor Bazarov wrote:

> Kim, Seungtai wrote:
> Have you encountered anything _in the real life_ that would be resolved
> by introducing the "enemy" specifier?  I haven't.

    There's a related situation where something similar might be
relevant.

    C++ allows member functions of a class to access the private
members of ANY objects of the class they can reach.  This allows copy
constructors, "swap", and similar functions.  But it's unusual
for a class to need to access private members of another object
of the same class.  There's no way to turn that access off,
though.  Perhaps there should be.

    The reason this matters is because it's a synchronization issue.
If a class locks the "this" object on entrance to a public
function member and unlocks it on exit, that protects
the "this" object.  It doesn't protect any other object
the member function can access and mess with.

    If C++ were to address class-level synchronization, as
Java does, this is an issue that should be addressed
at that time.

				John Nagle
				Animats


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



