Logical On

  • Thread starter Thread starter Cor
  • Start date Start date
Cor,
If you are saying that an implicit conversion from integer to String should
occur in:

Dim s As String
s = 0

Then Operator Overloading will enable us to define this behavior for our own
classes, not sure if the conversions will be defined for the base classes.
(they are some already defined, that are available in C# today).

My only concern with the above example is: Should the compiler use A or B
below?

A:
s = 0.ToString()

B:
s = "0"

C:
s = ChrW(0)

I would not expect C, however Herfried has a point.

Obviously if we used a variable instead of a literal (or constant) then B is
not an option. While for literals B would be more efficient.

Hope this helps
Jay
 
Back
Top