You can use a conversion operator when there is a natural and clear conversion to or from a different type.
Say for example that you have a data type for representing temperatures:
public enum TemperatureScale { Kelvin, Farenheit, Celsius }
public struct Temperature {
private TemperatureScale _scale;
private double _temp;
public Temperature(double temp, TemperatureScale scale) {
_scale = scale;
_temp = temp;
}
public static implicit operator Temperature(double temp) {
return new Temperature(temp, TemperatureScale.Kelvin);
}
}
Using the implicit operator you can assign a double to a temperature variable, and it will automatically be used as Kelvin:
Temperature a = new Temperature(100, TemperatureScale.Celcius);
Temperature b = 373.15; // Kelvin is default