omportamento tradicional baseado em tipo concreto para classe genéri
Desde minha pergunta deonte talvez não estivesse completamente claro e eu não recebi a resposta que queria, tentarei formulá-la de uma maneira mais geral:
Existe uma maneira de implementar um comportamento especial com base no tipo real de um tipo genérico instanciado usando instruções condicionais explícitas ou usando algum tipo de especialização? Pseudo-código
TGenericType <T> = class
function Func : Integer;
end;
...
function TGenericType <T>.Func : Integer;
begin
if (T = String) then Exit (0);
if (T is class) then Exit (1);
end;
...
function TGenericType <T : class>.Func : Integer;
begin
Result := 1;
end;
function TGenericType <String>.Func : Integer;
begin
Result := 0;
end;