[fpc-devel] Standard generic classes

J. Gareth Moreton gareth at moreton-family.com
Wed Jun 5 11:53:48 CEST 2019


Hah, oh that sounds fun!

I would develop something more lightweight and efficient, but that would 
just make a 4th poison to choose from.

Gareth aka. Kit


On 05/06/2019 08:01, Sven Barth via fpc-devel wrote:
> J. Gareth Moreton <gareth at moreton-family.com 
> <mailto:gareth at moreton-family.com>> schrieb am Di., 4. Juni 2019, 22:40:
>
>     Hi everyone,
>
>     I may be missing the obvious here, but I've noticed that there are
>     some
>     notable absences in the Free Generics Library.  While there's a
>     standard
>     list and a map and the like, there aren't any of the special lists
>     like
>     a stack and a queue and the like.  It proved slightly problematic
>     while
>     in a mentoring session with another programmer whom I was
>     introducing to
>     Free Pascal, because our sample project required a stack. The
>     standard
>     TStack uses pointers, which is not exactly portable.
>
>     If not present, can I request the addition of TFPGStack and
>     TFPGQueue to
>     the Free Generics Library? They should be simple descendants of of
>     TFPGList unless I'm missing something painfully obvious. Or am I
>     missing something even more obvious in that they are defined
>     elsewhere?
>
>
> Just to add a bit to the other answer: FPC has three generic 
> libraries: fgl, fcl-stl and rtl-generics.
> fgl is the oldest and also served as a testbed for the generics. It 
> cycles together with the compiler and is comparatively lightweight (at 
> least to the other two), but has some requirements when using records 
> as parameters and the performance isn't as good as that if rtl-generics.
> fcl-stl had been a contribution by a third party developer for a 
> C++-STL-like generics library.
> rtl-generics was also contributed by a third party developer for 
> Delphi compatibility, is rather performant, but also rather heavy weight.
>
> You can also see a speed comparison here: 
> http://www.benibela.de/fpc-map-benchmark_en.html
>
> In the end (if you don't need specific functionality like a stack ;) 
> ), it's a "pick your own poison" problem :P
>
> Regards,
> Sven
>
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190605/87ec185d/attachment.html>


More information about the fpc-devel mailing list