RTL enhancements
This commit is contained in:
@@ -16,17 +16,10 @@ type
|
||||
|
||||
private
|
||||
type
|
||||
IVal = interface
|
||||
{$ifdef DEBUG}
|
||||
function GetTypeHandle: Pointer;
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
TVal<T> = class(TInterfacedObject, IVal)
|
||||
TVal<T> = class(TInterfacedObject)
|
||||
Value: T;
|
||||
{$ifdef DEBUG}
|
||||
TypeHandle: Pointer;
|
||||
function GetTypeHandle: Pointer;
|
||||
{$endif}
|
||||
constructor Create(const AValue: T);
|
||||
end;
|
||||
@@ -176,13 +169,6 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
{$ifdef DEBUG}
|
||||
function TDataValue.TVal<T>.GetTypeHandle: Pointer;
|
||||
begin
|
||||
Result := TypeHandle;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
function TDataValue.AsLazy: ILazy;
|
||||
begin
|
||||
Assert(FKind = Ord(vkLazy));
|
||||
@@ -409,11 +395,7 @@ begin
|
||||
Ord(vkGeneric):
|
||||
// Getting meaningful type information for vkGeneric is not easily possible
|
||||
// without storing additional RTTI, as the specific type of T in TVal<T> is lost.
|
||||
{$ifdef DEBUG}
|
||||
Result := '<' + String(PTypeInfo(TDataValue.IVal(FInterface).GetTypeHandle).Name) + '>';
|
||||
{$else}
|
||||
Result := '<generic>';
|
||||
{$endif}
|
||||
Ord(vkLazy): Result := Format('<lazy[%s]>', [AsLazy.Kind.ToString]);
|
||||
else
|
||||
Result := '[Unknown DataValue]';
|
||||
|
||||
Reference in New Issue
Block a user