[Mono-list] implicit, explicit, and why does C# have these?

Arild Fines arild.fines@broadpark.no
Fri, 17 Oct 2003 15:42:07 +0200

David La Motta wrote:
> Thanks for the explanation.  I can see how the implicit operator can
> be useful in the example you describe; still, I think it wasn't
> necessary for C# to expose them to us.  I.e., let us deal with the
> explicit casts and spare the confusion they may cause.  In other
> words, an implicit cast from a Pear object to a Truck object can seem
> quite odd, assuming their inheritance tree has nothing in common.

Sure, but would you really want to be required to use an explicit cast when
converting an int to a long?


AnkhSVN: http://ankhsvn.tigris.org
Blog: http://ankhsvn.com/blog
RSS: http://ankhsvn.com/blog/Rss.aspx

King Crimson lives in different bodies at different times and the
particular form which the group takes changes. When music appears,
which only King Crimson can play then, sooner or later, King Crimson
appears to play the music