Can I overload operators for my own classes in Delphi?

I faced a little trouble - I do not know if I can define my own operators for my classes. For example:

  TMinMatrix = class(TMatrix)
      RowAmount: Byte;
      ColAmount: Byte;
      Data: DataMatrix;
      DemVector, SupVector: SupplyDemand;
      constructor Create(Rows, Cols: Byte);
      function GetRowAmount: Byte; override;
      function GetColAmount: Byte; override;
      destructor Destroy;

How can I - or can`t I:) - do something like:

TMinMatrix TMinMatrix::operator=(TMinMatrix* matr)    (c++ code)

And, by the way, can I define copy constructor for my class?


Operator overloading is possible in Delphi .NET versions, older versions of Delphi don't support it.

Delphi Win32 2007 and 2009 only supports class operator overload for records, you can have implicit and explicit operators. Delphi .Net supports class operators for records and classes.

Need Your Help

.Net Framework 4.0 - Opcodes.Box present in Dictionary with int key

c# .net dictionary garbage xbox360

I'm trying to investigate whether dictionaries with enum keys still generate garbage in newer versions of .Net (say >= 4)

AspectJ load-time weaving for signed jars

java tomcat aop aspectj load-time-weaving

Does anybody success in using AspectJ load-time weaving with signed jars?