Re[2]: [fpc-devel] Re: Illegal type conversion: "<enumeration type>"to "TObject"

Пётр Косаревский ppkk at mail.ru
Fri Jul 18 18:16:40 CEST 2008


> Boian hit it exactly;  we're doing this cast to store values in the 
> TStrings Objects[] property.  The current platform we're targeting is 
> Linux 32-bit, but we'll probably go to 64-bit at some point too, and it 
> would be nice if the cast continued to work as is.
> Craig

1. Why not use dummy class like "class tmyenum(tobject) e: myenumtype; end;"?
(extra typing is something like "(objects[i] as tmyenum).e" instead of typecasting, but you can [have to] "Free" it: it's normal object)

2. By the way, compared to Delphi, FPC with common arguments wastes much more memory on large amounts of such objects.



More information about the fpc-devel mailing list