mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 17:49:29 +02:00
+ add generic function TValue.From<> which is a shorthand of TValue.Make()
git-svn-id: trunk@37081 -
This commit is contained in:
parent
83e4585b0f
commit
92caf587f5
@ -73,6 +73,7 @@ type
|
||||
public
|
||||
class function Empty: TValue; static;
|
||||
class procedure Make(ABuffer: pointer; ATypeInfo: PTypeInfo; out result: TValue); static;
|
||||
generic class function From<T>(constref aValue: T): TValue; static; inline;
|
||||
function IsArray: boolean; inline;
|
||||
function AsString: string;
|
||||
function AsExtended: Extended;
|
||||
@ -698,6 +699,10 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
generic class function TValue.From<T>(constref aValue: T): TValue;
|
||||
begin
|
||||
TValue.Make(@aValue, System.TypeInfo(T), Result);
|
||||
end;
|
||||
|
||||
function TValue.GetTypeDataProp: PTypeData;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user