Is there an equivalent to the C++ friend keyword in C#?

  • Thread starter Thread starter Jean-Francois Hamelin
  • Start date Start date
Jean-Francois Hamelin said:
Hi,

Is there an equivalent to the C++ friend keyword in C#?

Nope. Only inner classes can see private members.

Also no multiple inheritence, no private inheritence, also only subtypes of
ValueType can be created on the stack, also no templates, also no anonymous
types.

David
 
Ahhh, the changes coming down the pike in C# 2.0... at least a few of those
things are finally addressed! ;)

--
HTH

Kyril Magnos

Question of the day:
What is Mono?
A) Disease where the lymph nodes become swollen.
B) A single sound
C) A synonym for one
D) A port of .NET meant to royally irritate MSFT
E) All of the above.

message | message | > Hi,
| >
| > Is there an equivalent to the C++ friend keyword in C#?
| >
|
| Nope. Only inner classes can see private members.
|
| Also no multiple inheritence, no private inheritence, also only subtypes
of
| ValueType can be created on the stack, also no templates, also no
anonymous
| types.
|
| David
|
|
 
Jean-Francois Hamelin said:
Hi,

Is there an equivalent to the C++ friend keyword in C#?

Thanks
JF

'internal' classes are about the closest thing that you can get.
 
Back
Top