3

Will all .NET languages support operator overloading or C# and managed C++ only support it?

2 Answers 2

5

The Common Language Specification does not enforce any rules in this regard on conforming languages. They should be able to use overloaded operators in various ways (either the language supports it or you'll do the method call yourself). A language is free to choose whether or not it should provide the ability to declare overloaded operators.

Sign up to request clarification or add additional context in comments.

2 Comments

How long will you be available on online today?.I know you are very strong at LINQ.I have to ask some LINQ based doubts.That is why i am asking.
@udanamehar: I'm not sure. I suggest you go on and ask your questions anyway, regardless of the time. I'm sure there are plenty of brilliant guys here who are good at LINQ and other stuff.
2

Not all languages will support it but many do. You also need to break the support down into 2 categories

  1. Allowing the language to define overloaded operators
  2. Having the language consume other overloaded operators

VB.Net supports both and I believe IronPython and IronRuby do as well in a dynamic way.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.