Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Examples of Implicit Variable Assignment in C#

I noticed you can do this sort of thing in C#:

XNamespace c = "http://s.opencalais.com/1/pred/";

Notice the string value is implicitly converted to different type. Are there other places this can be done? What are some common patterns and practices around this sort of thing?

like image 556
Paul Fryer Avatar asked Aug 08 '10 20:08

Paul Fryer


1 Answers

This can happen whenever an implicit conversion operator is defined. All in all it is quite rare.

like image 166
Matt Greer Avatar answered Sep 20 '22 10:09

Matt Greer