| CreateList<T> |
Creates a resizable list of values. |
| CreateList<T>(IEqualityComparer<T>) |
Creates a resizable list that uses an equality comparer for lookup operations. |
Creates a resizable list of values.
Delphi
class function CreateList<T>: IList<T>; overload; static;
Type Parameters
- T
The type of values in the list.
Returns
IList<T>
A new IList<T> instance.
delphi
var
Names: IList<string>;
begin
Names := TCollections.CreateList<string>;
Names.AddRange(['Ada', 'Grace']);
end;
Creates a resizable list that uses an equality comparer for lookup operations.
Delphi
class function CreateList<T>(const Comparer: IEqualityComparer<T>): IList<T>; overload; static;
Type Parameters
- T
The type of values in the list.
Parameters
- Comparer
- IEqualityComparer<T>
The IEqualityComparer<T> used by lookup operations such as IReadOnlyCollection<T>.Contains and IList<T>.IndexOf.
Returns
IList<T>
A new IList<T> instance.
If Comparer is nil, the list uses the default
equality comparer for type T. Sorting still
uses the comparer or comparison callback passed to
IList<T>.Sort.