Hi,

In Delphi you can overload the Explicit operator. This makes is possible to 
have a type TTypeX and TTypeY and cast one into the other. To do that, 
implement an operator overloader:
  operator Explicit(const AValue: TTypeX): TTypeY.
  // implement converstio from TTypeX to TTypeY.

Then you can do stuff like
var
  tx: TTypeX;
  ty: TTypeY;
begin
  tx := TTypeX.Create;
  ty := TTypeY(tx);
end;

Is something like this possible in FPC?

Kind regards,
  Birger

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to