Using Generic containers in Delphi XE - always?

后端 未结 7 1209
星月不相逢
星月不相逢 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:20

    In Delphi XE, there is no reason not to use generic containers.

    Switching from the old method with casting will give you:

    • cleaner, type-safe, less error-prone code,
    • enumerators, for in loops,
    • the samebetter performance characteristics.

提交回复
热议问题