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

Michael Van Canneyt michael at freepascal.org
Wed May 17 10:53:01 CEST 2006



On Wed, 17 May 2006, Graeme Geldenhuys wrote:

> 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.

I thought it came from there.

Even so:
This Assign() method does not need to use a variant, but can still offer
the same functionality as it does now. It just means that the method
needs to determine the actual type itself...

>
> 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.

Variants are not required for this.
Variants are for (excuse me the term) lazy coders...

But I don't suggest rewriting tiOPF for this, it might lead a little bit
too far :-)

Michael.



More information about the fpc-devel mailing list