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 parameter or I can define it as: function Compare(A, B: T): Integer; virtual; abstract;. But this way the function cannot be inlined. Question: Is there a way how to *inline* compare function to sorting method in this general purpose generic abstract class? Thanks. PS: The gain is 6-7%. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class
Vojtěch Čihák via fpc-pascal Mon, 14 Nov 2022 10:26:37 -0800
- [fpc-pascal] How to inline CompareFunc to ... Vojtěch Čihák via fpc-pascal
- Re: [fpc-pascal] How to inline Compar... Hairy Pixels via fpc-pascal
- Re: [fpc-pascal] How to inline Compar... Flávio Etrusco via fpc-pascal
- Re: [fpc-pascal] How to inline C... Vojtěch Čihák via fpc-pascal
- Re: [fpc-pascal] How to inlin... Flávio Etrusco via fpc-pascal
- Re: [fpc-pascal] How to inline Co... Sven Barth via fpc-pascal
- Re: [fpc-pascal] How to inline Compar... Sven Barth via fpc-pascal
- Re: [fpc-pascal] How to inline Co... Hairy Pixels via fpc-pascal
- Re: [fpc-pascal] How to inlin... Sven Barth via fpc-pascal
- Re: [fpc-pascal] How to inline Co... Flávio Etrusco via fpc-pascal
- Re: [fpc-pascal] How to inline Compar... Adrian Veith via fpc-pascal