mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 08:12:09 +02:00
+ TFPGObjectList.GetEnumerator and TFPGInterfacedObjectList.GetEnumerator, resolves #18094
git-svn-id: trunk@16471 -
This commit is contained in:
parent
97ac6ab928
commit
6b42ba170b
@ -140,6 +140,7 @@ type
|
||||
TTypeList = array[0..MaxGListSize] of T;
|
||||
PTypeList = ^TTypeList;
|
||||
PT = ^T;
|
||||
TFPGListEnumeratorSpec = specialize TFPGListEnumerator<T>;
|
||||
{$ifndef OldSyntax}protected var{$else}var protected{$endif}
|
||||
FOnCompare: TCompareFunc;
|
||||
FFreeObjects: Boolean;
|
||||
@ -154,6 +155,7 @@ type
|
||||
function Add(const Item: T): Integer; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function Extract(const Item: T): T; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function First: T; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function GetEnumerator: TFPGListEnumeratorSpec; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function IndexOf(const Item: T): Integer;
|
||||
procedure Insert(Index: Integer; const Item: T); {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function Last: T; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
@ -174,6 +176,7 @@ type
|
||||
TTypeList = array[0..MaxGListSize] of T;
|
||||
PTypeList = ^TTypeList;
|
||||
PT = ^T;
|
||||
TFPGListEnumeratorSpec = specialize TFPGListEnumerator<T>;
|
||||
{$ifndef OldSyntax}protected var{$else}var protected{$endif}
|
||||
FOnCompare: TCompareFunc;
|
||||
procedure CopyItem(Src, Dest: Pointer); override;
|
||||
@ -187,6 +190,7 @@ type
|
||||
function Add(const Item: T): Integer; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function Extract(const Item: T): T; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function First: T; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function GetEnumerator: TFPGListEnumeratorSpec; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function IndexOf(const Item: T): Integer;
|
||||
procedure Insert(Index: Integer; const Item: T); {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
function Last: T; {$ifdef CLASSESINLINE} inline; {$endif}
|
||||
@ -880,6 +884,11 @@ begin
|
||||
Result := T(inherited First^);
|
||||
end;
|
||||
|
||||
function TFPGObjectList.GetEnumerator: TFPGListEnumeratorSpec;
|
||||
begin
|
||||
Result := TFPGListEnumeratorSpec.Create(Self);
|
||||
end;
|
||||
|
||||
function TFPGObjectList.IndexOf(const Item: T): Integer;
|
||||
begin
|
||||
Result := 0;
|
||||
@ -990,6 +999,11 @@ begin
|
||||
Result := T(inherited First^);
|
||||
end;
|
||||
|
||||
function TFPGInterfacedObjectList.GetEnumerator: TFPGListEnumeratorSpec;
|
||||
begin
|
||||
Result := TFPGListEnumeratorSpec.Create(Self);
|
||||
end;
|
||||
|
||||
function TFPGInterfacedObjectList.IndexOf(const Item: T): Integer;
|
||||
begin
|
||||
Result := 0;
|
||||
|
Loading…
Reference in New Issue
Block a user