TStringList vs. TList

前端 未结 8 1890
野性不改
野性不改 2021-02-05 02:31

what is the difference in using a standard

type 
  sl: TStringList 

compared to using a generic TList

type 
  sl: TList

        
8条回答
  •  你的背包
    2021-02-05 02:43

    For most purposes that TStringList has been abused in the past, TObjectDictionary is better - it's faster and doesn't need sorting.

    If you need a TStrings object (generally for UI stuff, since the VCL doesn't use generics much even for XE5) use TStringList - the required casting from TObject is annoying but not a showstopper.

提交回复
热议问题