以下内容无效,我想我的意图可以从代码中读取。如果可能,我找不到示例或文档。
type
TV2<T> = record
X: T;
Y: T;
class operator add(a,b: TV2<T>): TV2<T>;
end;
TV2S = TV2<Single>;
TV2I = TV2<Int64>;
implementation
class operator TV2<T>.add(a, b: TV2<T>): TV2<T>;
begin
Result.X := a.X + b.X; // I'm getting "E2015 Operator not applicable to this operand type"
Result.Y := a.Y + b.Y; // I'm getting "E2015 Operator not applicable to this operand type"
end;