[fpc-devel] GetPropValue and enumerated types (Bug #4738 follow-up)

Graeme Geldenhuys graemeg.lists at gmail.com
Wed May 17 10:47:13 CEST 2006


Hi Michael,

I do understand that variants are slow, but unfortunately I can't get
rid of them.  I use the tiOPF framework and in the framework we
created a generic Assign method in our base class used for all
objects.

The Assign uses RTTI extensively with variants to handle all
datatypes, except class types that the user might have added.  This
works perfectly, and the user never needs to worry about creating a
custom Assign method for any object, the framework handles all that.

The original example referred to in the bug report shows a bit of how
the framework does that, but might have complicated the example app to
much.  That is why I posted a much simpler example now.

Regards,
  - Graeme -


> While I think this is a bug that should be solved, I would suggest
> to avoid the use of variants as much as possible. Your code can be
> made a lot faster (and bug-free) by avoiding the use of variants
> in the first place. This is valid for FPC, but also for Delphi.
>
> Michael.


-- 
There's no place like 127.0.0.1


More information about the fpc-devel mailing list