Am 23.03.2017 16:29 schrieb "Ryan Joseph" <r...@thealchemistguild.com>:
>
> I have some generics which operate on multiple types and instead of
making subclasses for certain types and overriding methods I wonder if
using the RTTI like:
>
> PTypeInfo(TypeInfo(T))^.kind = tkClass
>
> would be a good idea. How is TypeInfo() implemented exactly? I’m curious
if there are any string comparing, allocating memory etc... that would
adversely affect performance since these classes need to perform fast data
lookups/insertions.

TypeInfo() simply inserts the load of a pointer value, so there's not even
a call.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to