Re: [fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class

2022-11-14 Thread Hairy Pixels via fpc-pascal
There’s no way since FPC can’t inline function pointers (I asked already a while ago). It depends on what’s in your list but you can often override comparison operators (like =, < and >) or restructure your classes so there is a base last and then 2+ subclasses that have the top level sorting m

[fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class

2022-11-14 Thread Vojtěch Čihák via fpc-pascal
Hi,   I wrote a generic abstract class - a list based on dynamic array (i.e. array of T;) and this class can be specialized elsewhere with any type (records or classes). Part of the class is sorting. There are more ways how to deliver *compare function* to sorting method. I can pass it as a para