Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$apptype console}
- uses TypInfo;
- type
- C = class
- public
- class procedure P<T>(value: T);
- end;
- class procedure C.P<T>(value: T);
- begin
- Writeln(PTypeInfo(TypeInfo(T))^.Name);
- end;
- var
- a, b: Integer;
- begin
- a := 1; b := 1;
- C.P(42); // an anonymous type roughly equivalent to 42..42
- C.P(a);
- C.P(a / b);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement