|
@@ -142,6 +142,7 @@ type
|
|
Type
|
|
Type
|
|
TFPGListEnumeratorSpec = specialize TFPGListEnumerator<T>;
|
|
TFPGListEnumeratorSpec = specialize TFPGListEnumerator<T>;
|
|
constructor Create;
|
|
constructor Create;
|
|
|
|
+
|
|
class Function ItemIsManaged : Boolean; override;
|
|
class Function ItemIsManaged : Boolean; override;
|
|
function Add(const Item: T): Integer; {$ifdef FGLINLINE} inline; {$endif}
|
|
function Add(const Item: T): Integer; {$ifdef FGLINLINE} inline; {$endif}
|
|
function Extract(const Item: T): T; {$ifdef FGLINLINE} inline; {$endif}
|
|
function Extract(const Item: T): T; {$ifdef FGLINLINE} inline; {$endif}
|
|
@@ -968,7 +969,11 @@ end;
|
|
|
|
|
|
class function TFPGList.ItemIsManaged: Boolean;
|
|
class function TFPGList.ItemIsManaged: Boolean;
|
|
begin
|
|
begin
|
|
|
|
+{$IFNDEF VER3_0}
|
|
Result:=IsManagedType(T);
|
|
Result:=IsManagedType(T);
|
|
|
|
+{$ELSE}
|
|
|
|
+ Result:=True; // Fallback to old behaviour
|
|
|
|
+{$ENDIF}
|
|
end;
|
|
end;
|
|
|
|
|
|
function TFPGList.GetEnumerator: TFPGListEnumeratorSpec;
|
|
function TFPGList.GetEnumerator: TFPGListEnumeratorSpec;
|
|
@@ -1011,7 +1016,7 @@ var
|
|
i: Integer;
|
|
i: Integer;
|
|
|
|
|
|
begin
|
|
begin
|
|
- if IsManagedType(T) then
|
|
|
|
|
|
+ if ItemIsManaged then
|
|
begin
|
|
begin
|
|
Capacity:=Capacity+Source.Count;
|
|
Capacity:=Capacity+Source.Count;
|
|
for I := 0 to Source.Count - 1 do
|
|
for I := 0 to Source.Count - 1 do
|
|
@@ -1023,7 +1028,7 @@ end;
|
|
|
|
|
|
procedure TFPGList.Assign(Source: TFPGList);
|
|
procedure TFPGList.Assign(Source: TFPGList);
|
|
begin
|
|
begin
|
|
- if IsManagedType(T) then
|
|
|
|
|
|
+ if ItemIsManaged then
|
|
begin
|
|
begin
|
|
Clear;
|
|
Clear;
|
|
AddList(Source);
|
|
AddList(Source);
|