mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:26:15 +02:00
* use a TObject constraint for TFPGObjectList and TFPGObjectMap to ensure that only TObject and its descendants
are used (allows for a better error message) git-svn-id: trunk@39363 -
This commit is contained in:
parent
fdc896ad0a
commit
ddb501bddf
@ -153,7 +153,7 @@ type
|
|||||||
property List: PTypeList read GetList;
|
property List: PTypeList read GetList;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
generic TFPGObjectList<T> = class(TFPSList)
|
generic TFPGObjectList<T: TObject> = class(TFPSList)
|
||||||
private
|
private
|
||||||
type
|
type
|
||||||
TCompareFunc = function(const Item1, Item2: T): Integer;
|
TCompareFunc = function(const Item1, Item2: T): Integer;
|
||||||
@ -330,7 +330,7 @@ type
|
|||||||
property OnDataCompare: TDataCompareFunc read FOnDataCompare write SetOnDataCompare;
|
property OnDataCompare: TDataCompareFunc read FOnDataCompare write SetOnDataCompare;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
generic TFPGMapObject<TKey, TData> = class(TFPSMap)
|
generic TFPGMapObject<TKey; TData: TObject> = class(TFPSMap)
|
||||||
private
|
private
|
||||||
type
|
type
|
||||||
TKeyCompareFunc = function(const Key1, Key2: TKey): Integer;
|
TKeyCompareFunc = function(const Key1, Key2: TKey): Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user