From -4108962646421151693
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,5e0145d162a6d1d6
X-Google-Attributes: gidf78e5,public
From: "Daniel Parker" <danielp@nospam.com>
Subject: Re: Why is granting friendship to a templ. parameter ill-formed?
Date: 1998/03/10
Message-ID: <6e2i9u$rig$1@news.interlog.com>#1/1
X-Deja-AN: 332582659
References: <6dop9s$kq6$1@news.utu.fi> <35005B2A.7410@cs.wayne.edu> <1yiuppeaon.fsf@dshp01.ntc.nokia.com>
X-Original-Date: Tue, 10 Mar 1998 00:10:09 -0000
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Interlog Internet Services
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANQUYjOEDnX0m9pzZAQHdFQF+J0V4gRqsxY7Eq+L9866HrkTtFMRlUCEx 7RrS71ruv3rxBCzOlTO2vYcJzLsMpIoJ =d0OC
Newsgroups: comp.std.c++


Marc Girod wrote in message <1yiuppeaon.fsf@dshp01.ntc.nokia.com>...
>>>>>> "SV" == Srinivas Vobilisetti <srv@cs.wayne.edu> writes:
>
>SV> To prevent back door access to template class's private members. If you
>SV> give friendship based on the template parameter, then any class can get
>SV> access to the template private members thru back door
>
>"Back door"??? What is the front door then? This would only be
>clear and explicit. It could be the only access. I know I lack it
>badly, and where I do, I have to make the access public and put
>dynamic guards: a shame!

I agree wholeheartedly with this post; the justification stated above is,
quite frankly, nuts.  What it means is that the developer is compelled to
make a data member public that he'd rather not, which is bad.  If the intent
of the standard was to prevent the client from discovering a way of misusing
a class, I have some very bad news:  in C++ it is always possible for the
client to misue a class.  That's a non-issue, utterly beside the point.

Regards,
Daniel Parker

--
Please do not use reply, use danielp@anabasis.com instead.
---
[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]



