[SOLVED] FGL versus rtl-generics aka Generic.Collections lazarus / 21-General ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2025-08-02 01:58 Hey Y'all, I've been dipping my feet into the usage of generics and due to the fact that bot of the above mentioned options exist out of the box, I never quite got to ask: Are there any specific reasons to use one or the other?What are the pros and cons of using one or the other? I'm sorry to be asking such a newb set of questions!! It's been in my todo list to get these answers for quite a while. And I guess I'll admit I'm lazy to dive into the code to find it for myself. With that in mind, and my apologies for being such a generics newb, I ask the community at large to give me a good answer. As I'm, shamefully yes, lazy to do a deep dive into then code, and for that I deeply apologise !! If this has been already discussed in a previous post, I would deeply appreciate a link to it, or them, if more than one exists. Cheers, Gus ---------------------------------------------------------------------- Thaddy · 2025-08-02 03:36 pro's - fgl is lightweight but still contains most of the common patterns. - rtl-generics is Delphi compatible and has more patterns. con's - fgl is not Delphi compatible - rtl-generics is heavy in code. I use them both, and also lgenerics. ---------------------------------------------------------------------- marcov · 2025-08-02 10:37 fcl-stl is an attempt to build for the pre delphi compatible generics. Those are a bit less declarative, so in theory you should be able to do things with value types with fcl-stl and fgl that you can't do with rtl-generics, most notably call identifiers on the generic type in the unspecialized generic. I tried this sometimes, but it is hard to use and sensitive. So I always use rtl-generics which IS generics.collections. In older Lazarus versions there was a copy of rtl-generics in lazarus to suit FPC 3.0 and 3.0.2, but that should not be necessary after FPC 3.2.0, maybe even 3.0.4 ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2025-08-03 13:31 Hey Thaddy and Marco, Thank you very much for your answers!! That did scratch my itch quite good!! Cheers, Gus