Operator overloading in Delphi Win32 works only for records, not for classes.
It works from Delphi 2006 and up, but there were some bugs fixed in Delphi 2007 that make them easier to work with (having to do with calling functions on operator results).
I gave a session on Record Operator Overloading on CodeRage 3; You can get the slides and sample code at 26326 CR3: Nullable Types w/ Records, Methods & Operator Overloading, and/or watch the video replay at DOWNLOAD VIDEO REPLAY.
This was the session abstract:
Nullable Types with Records, Methods
and Operator Overloading One of the
things where data from databases and
Delphi native types differ, is the
support for NULL. When you work with
databases a lot in Delphi, you want to
have a datatype that supports NULL. In
the past you had to use variants, but
not any more! With the introduction of
operator overloading, you can do this
with record types, too. This session
shows you how.
The reason operator overloading is only possible for records in Delphi Win32 (i.e. non .NET), is that records are value types, so their memory management is non-dynamic. Classes are reference types, hence require dynamic memory allocation: they require the concept of a garbage collector in order for operators to work on them.
Since there is no concept of a garbage collector in Delphi Win32, it is not possible in to have operators for classes in Delphi Win32.
Note that CodeRage 4 starts next week. It has a nice line up of speakers and sessions.