Using Generic containers in Delphi XE - always?

后端 未结 7 1229
星月不相逢
星月不相逢 2021-02-03 10:45

Generic containers can be a time saver when having a item, and a strongly typed list of those items. It saves the repetitive coding of creating a new class with perhaps a TList

7条回答
  •  无人共我
    2021-02-03 11:21

    In most cases, yes, generic containers are a good thing. However, the compiler generates a lot of duplicate code, and unfortunately the linker doesn't know how to remove it yet, so heavy use of generics could result in a bloated executable. But other than that, they're great.

提交回复
热议问题