From 7450894428102060817
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!news.zanker.org!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!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: AlbertoBarbati@libero.it (Alberto Barbati)
Newsgroups: comp.std.c++
Subject: Re: Relation of enermy(anti-friend)
Date: Sat, 28 Aug 2004 04:01:35 GMT
Organization: [Infostrada]
Lines: 29
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <_DNXc.60250$1V3.1510870@twister2.libero.it>
References: <cgk8od$vai$1@news.kreonet.re.kr> <tXqXc.319$Ae.239@newsread1.dllstx09.us.to.verio.net> <cgm0vs$2eu$1@news.kreonet.re.kr> <kAzXc.52507$9d6.50035@attbi_s54> <2p96gdFi3ckuU1@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 1093665699 709 158.152.254.254 (28 Aug 2004 04:01:39 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 28 Aug 2004 04:01:39 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040514
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-Accept-Language: en, it
X-Virus-Scanned: by amavisd-new at libero.it
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 i7S41ZHd001049;
	Sat, 28 Aug 2004 14:01:35 +1000 (EST)
X-NNTP-Posting-Date: Fri, 27 Aug 2004 23:24:10 MET DST
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++:2269

Jonathan Turkanis wrote:

> 
> I think the real reason that an enemy relation would be of no use is that it
> would be so easily circumvented. The enemy could simply access the public
> members of the forbidden class through a thin wrapper. [...]
> 

The enemy relation can circumvented even more easily than that: just 
change the name of the class!

Jokes apart, that is a serious inconvenient. As it is, the enemy 
relation is nothing more than an aid to the programmer. It just help you 
  to avoid making mistakes in your own classes. Other programmers are 
completely unaffected because you don't have any control on the names 
used by them. In fact, the enemy relation is not even good at that, 
because any mistake in the naming of your classes will probably go 
undetected. A false sense of security is even worse than no security at all.

Just my opinion,

Alberto

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



