您好我已经写了这段代码,但我不知道它有什么问题
namespace NumericsType
{
public float X,Y;
public Vec2D_Struct(float x, float y)
{
X = x;
Y = y;
}
// this line or rather 'implicit' give an compiler error
// CS1020: Overloadable binary operator expected
public static implicit operator Vec2D_Struct(float x, float y)
{
return new Vec2D_Struct(x,y);
}
// other operator overload +, -
}
代码有问题吗?我正在使用C#
由于