mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 20:26:00 +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
|
public
|
||||||
class function Empty: TValue; static;
|
class function Empty: TValue; static;
|
||||||
class procedure Make(ABuffer: pointer; ATypeInfo: PTypeInfo; out result: 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 IsArray: boolean; inline;
|
||||||
function AsString: string;
|
function AsString: string;
|
||||||
function AsExtended: Extended;
|
function AsExtended: Extended;
|
||||||
@ -698,6 +699,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
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;
|
function TValue.GetTypeDataProp: PTypeData;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user