I want some way to write a function in delphi like the following
procedure Foo<T>;
begin
if T = String then
begin
//Do something
end;
if T = Double then
begin
//Do something else
end;
end;
ie: I want to be able to do different things based on a generic type
I've tried using TypeInfo
in System
but this seems to be suited to objects rather than generic types.
I'm not even sure this is possible in pascal
TypeInfo
should work: