Operator Over Loading
-
Hi all Can any one explain why C# does not suport for overloading =,.,sizeof,new operators? I am in the need to overload the operator '='.Is there any other way to redifine the functionality of '='. M.Sendilkumar
-
Hi all Can any one explain why C# does not suport for overloading =,.,sizeof,new operators? I am in the need to overload the operator '='.Is there any other way to redifine the functionality of '='. M.Sendilkumar
Sendilkumar.M wrote: Can any one explain why C# does not suport for overloading =,.,sizeof,new operators? I am in the need to overload the operator '='.Is there any other way to redifine the functionality of '='. Probably because the environment is garbage collected. Those operators you describe are tipically used when you need to implement your own memory management mechanism in C++. This is simply not possible in C#. About the '.' operator (in C++, the '->' operator), you don't need it because C# has property get/set pairs, so it's a much more elegant and simple solution to the same problem. Yes, even I am blogging now!
-
Sendilkumar.M wrote: Can any one explain why C# does not suport for overloading =,.,sizeof,new operators? I am in the need to overload the operator '='.Is there any other way to redifine the functionality of '='. Probably because the environment is garbage collected. Those operators you describe are tipically used when you need to implement your own memory management mechanism in C++. This is simply not possible in C#. About the '.' operator (in C++, the '->' operator), you don't need it because C# has property get/set pairs, so it's a much more elegant and simple solution to the same problem. Yes, even I am blogging now!
Tnx a lot M.Sendilkumar