Why aren’t the assignment operators (+=, -=, *=, /=) overloadable in VB.NET?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Perhaps this is their reasoning:
There’s something called ‘Narrowing’ and ‘Widening’ which allows you to define explicit and implicit converters from one type to another, i.e.
But that doesn’t let change the assignment operator for assigning an instance of the same class, only converting other classes.
See How to: Define a Conversion Operator
Same in C#
=, ., ?:, ??, ->, =>, f(x), as, checked, unchecked, default, delegate, is, new, sizeof, typeofWith the same conversion operators: