public void CustomTypeConversions() { // In terms of the intrinsic numerical types (sbyte, int, float, etc.), an explicit conversion is required when //you attempt to store a larger value in a smaller container, as this could result in a loss of data. Conversely, an //implicit conversion happens automatically when you attempt to place a smaller type in a destination type that will not result in a loss of data: int a = 123; long b = a; // implicit int c = (int)b; // explicit // C# provides two keywords,explicit and implicit, that you can use to control how your types respond during an attempted conversion. Point p = new Point() { X = 2, Y = 1 }; PointSpace ps = p; Point p2 = (Point)ps; // conversion routines make use of the C# operator keyword, in conjunction with the explicit or implicit keyword, and must be defined as static. The incoming parameter is the // entity you are converting from, while the operator type is the entity you are converting to. PointSpace ps2 = 1; int i = (int)ps2; // the incoming operator -> entity converting from, operator type -> converting to; }
public static T[,] op_Division(T[,] matrix, T point) => PointSpace.op_Division(matrix, point);
public static T[,] op_Concatenate(T[,] matrix, T point) => PointSpace.op_Concatenate(matrix, point);
public static T[,] op_Multiply(T[,] matrix, T point) => PointSpace.op_Multiply(matrix, point);
public static T[,] op_Subtraction(T[,] matrix, T point) => PointSpace.op_Subtraction(matrix, point);
public static T[,] op_Addition(T[,] matrix, T point) => PointSpace.op_Addition(matrix, point);
public static T[,] op_BitwiseOr(T[,] matrix, T point) => PointSpace.op_BitwiseOr(matrix, point);
public static T[,] op_BitwiseAnd <T>(this T[,] matrix, T point) => PointSpace.op_BitwiseAnd(matrix, point);