|
@@ -185,6 +185,7 @@ type
|
|
private
|
|
private
|
|
function GetItem(AIndex: SizeInt): T;
|
|
function GetItem(AIndex: SizeInt): T;
|
|
procedure SetItem(AIndex: SizeInt; const AValue: T);
|
|
procedure SetItem(AIndex: SizeInt; const AValue: T);
|
|
|
|
+ function GetIsEmpty: Boolean;
|
|
public
|
|
public
|
|
type
|
|
type
|
|
TEnumerator = class(TCustomListEnumerator<T>);
|
|
TEnumerator = class(TCustomListEnumerator<T>);
|
|
@@ -236,6 +237,7 @@ type
|
|
function BinarySearch(const AItem: T; out AIndex: SizeInt; const AComparer: IComparer<T>): Boolean; overload;
|
|
function BinarySearch(const AItem: T; out AIndex: SizeInt; const AComparer: IComparer<T>): Boolean; overload;
|
|
|
|
|
|
property Count: SizeInt read FLength write SetCount;
|
|
property Count: SizeInt read FLength write SetCount;
|
|
|
|
+ property IsEmpty: Boolean read GetIsEmpty;
|
|
property Items[Index: SizeInt]: T read GetItem write SetItem; default;
|
|
property Items[Index: SizeInt]: T read GetItem write SetItem; default;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -890,6 +892,11 @@ begin
|
|
Result := GetEnumerator;
|
|
Result := GetEnumerator;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TList<T>.GetIsEmpty: Boolean;
|
|
|
|
+begin
|
|
|
|
+ Result := Count = 0;
|
|
|
|
+end;
|
|
|
|
+
|
|
function TList<T>.GetItem(AIndex: SizeInt): T;
|
|
function TList<T>.GetItem(AIndex: SizeInt): T;
|
|
begin
|
|
begin
|
|
if (AIndex < 0) or (AIndex >= Count) then
|
|
if (AIndex < 0) or (AIndex >= Count) then
|