Topic: Acquaintances


Author: sakkinen@jyu.fi (Markku Sakkinen)
Date: 5 Apr 92 14:59:27 GMT
Raw View
In article <7421@uqcspe.cs.uq.oz.au> warwick@cs.uq.oz.au writes:
>krc@wam.umd.edu (Kevin R. Coombes) writes:
>
>>Has any consideration been given to the possibility of adding a weaker
>>version of friendship to the language? Basically, I'm thinking of a
>>function or class that would be allowed access to protected members
>>but not to private members. From a language design standpoint, this seems
>>reasonable, if only because it would extend the public-protected-private
>>trichotomy to something like general-acquaintance-friend.
>
>Would something like this suffice:
>
> class A { int priv; protected: int prot; };
> class Aprot : public A { friend Amunger(); };
>
>Allowing Amunger to access "prot" ?????

No, he certainly meant:

 class A { protected: int prot; acquaintance void Amunger(); ...

I happened to suggest the same in a manuscript just recently submitted
for publication.  In that context, 'acquaintance' just had already
a somewhat weaker meaning, so I proposed 'comrade' -- not in full earnest.

----------------------------------------------------------------------
Don't smell rotten -- avoid a "look and smell" litigation from
Apple Computer.

Markku Sakkinen (sakkinen@jytko.jyu.fi)
       SAKKINEN@FINJYU.bitnet (alternative network address)
Department of Computer Science and Information Systems
University of Jyvaskyla (a's with umlauts)
PL 35
SF-40351 Jyvaskyla (umlauts again)
Finland
----------------------------------------------------------------------




Author: warwick@cs.uq.oz.au (Warwick Allison)
Date: 3 Apr 92 04:28:49 GMT
Raw View
krc@wam.umd.edu (Kevin R. Coombes) writes:

>Has any consideration been given to the possibility of adding a weaker
>version of friendship to the language? Basically, I'm thinking of a
>function or class that would be allowed access to protected members
>but not to private members. From a language design standpoint, this seems
>reasonable, if only because it would extend the public-protected-private
>trichotomy to something like general-acquaintance-friend.

Would something like this suffice:

 class A { int priv; protected: int prot; };
 class Aprot : public A { friend Amunger(); };

Allowing Amunger to access "prot" ?????

(This is stretching my C++ knowledge too far)



Warwick
--
  _-_|\      warwick@cs.uq.oz.au            / pinots pintos /
 /     * <-- Computer Science Department,  / piston pitons /
 \_.-._/     University of Queensland,    / points potins /
      v      Brisbane, Australia.        / ------ ------ /