Cross-reference between delphi records

Posted by Paul-Jan on Stack Overflow See other posts from Stack Overflow or by Paul-Jan
Published on 2010-03-10T21:16:50Z Indexed on 2010/03/11 5:08 UTC
Read the original article Hit count: 308

Filed under:
|

Let's say I have a record TQuaternion and a record TVector. Quaternions have some methods with TVector parameters. On the other hand, TVector supports some operations that have TQuaternion parameters.

Knowing that Delphi (Win32) does not allow for forward record declarations, how do I solve this elegantly?

Using classes is not really an option here, because I really want to use operator overloading for this rare case where it actually makes good sense.

For now I simply moved these particular methods out of the records and into separate functions, the good old-fashioned way. Better suggestions are most welcome.

© Stack Overflow or respective owner

Related posts about delphi

Related posts about delphi-2010