tw29792.pp 414 B

123456789101112131415161718192021222324252627282930313233
  1. unit tw29792;
  2. {$mode delphi}
  3. interface
  4. type
  5. { TMyRecord }
  6. TMyRecord<T> = record
  7. class operator Add(A,B: TMyRecord<T>): TMyRecord<T>;
  8. end;
  9. implementation
  10. { TMyRecord }
  11. class operator TMyRecord<T>.Add(A, B: TMyRecord<T>): TMyRecord<T>;
  12. begin
  13. // add implementation
  14. end;
  15. procedure TestIfCompiles;
  16. type
  17. TInteger = TMyRecord<Integer>;
  18. var
  19. N1, N2, N3: TInteger;
  20. begin
  21. N1 := N2 + N3;
  22. end;
  23. end.