|
Hello!
Just check for the following features in C# specs or
overviews:
1. overloadable operators
2. member access
In short operator
overloading is available, however, directly overloadable operators form a subset
of all operators used in C# i.e operator = cannot be overloaded
directly.
Some operators are overloaded indirectly i.e +=
is evaluated using overloded + operator.
Member access is more fine grained controlled than in
C++, however, there is no equivalent of friend methods. There is "internal"
member access modifier which allows for assembly
visibility.
This situation has some negative impact on programmer
control over structure of program written in C#. But CLI infrastructure supports
multiple programming languages (currently more than a dozen languges have
compilers targeting CLI at least MSFT version) including C++ and
it is up to you to choose language of your
choice providing most features you need.
At the end there is ILAsm language, which can be
shortly described as intermediate assembler language. ILAsm is a basis for
defining CLI functionality. ILAsm level is somewhere between "classical"
assembler and higher level languages and since it defines CLI functionality it
has the least semantic limitations of any of CLI languages. Fortunately it is
straghtforward to learn and can be used for coding features which can not
be coded directly in any of the available higher level
languages.
ILAsm provides more visibility modifiers: family,
familyorassem, familyandassem. family means that member is visible from
declaring class and all descendats, familiandassem, familyorassembly provide
ligical modification of visibility based on assembly
location.
Hope this helps.
Jacek From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rohit K Gupta Sent: Friday, July 23, 2004 6:15 AM To: MONO Subject: [Mono-list] C# Functionality Hi to all,
i was wondering about the fact that
as C++ provides for Operator Overloading and Friend
Functions
,does C# Provide such functionality?
Operator overloading is as its name
implies
we can define operator
functionalities for user defined classes
and friend functions are those which can be defined
outside the class but declared friend to the user defined class so that it can
access private memebers of the class.
now by friend where i am confused
is
in C# we can define friend classes, members and
functions but those are part of class and can be accessed in same assembly
only by making the instace of the class
whereas the c++ friend function can be called
without instace of object but just by passing it in arguments
this blurs my c++ concepts
am i thinking right or worng?
just help me
Thanks & Regards
Rohit
|
- [Mono-list] C# Functionality Rohit K Gupta
- Re: [Mono-list] C# Functionality David Waite
- Re: [Mono-list] C# Functionality infodate
- Re: [Mono-list] C# Functionality Richard Thombs
- RE: [Mono-list] C# Functionality J�r�me Laban
