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

  • Thread starter Thread starter Jean-Francois Hamelin
  • Start date Start date
J

Jean-Francois Hamelin

Hi,

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

Thanks
JF
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top