Closed GoogleCodeExporter closed 9 years ago
I have this problem too
Original comment by edwin....@innovationgear.com
on 10 Jul 2013 at 12:40
Does D2010 has constraints ?
http://docwiki.embarcadero.com/RADStudio/XE4/en/Constraints_in_Generics
If it does - would re-formulation fix the issue ?
function TOmniValue.ToObject<T: class>: T;
begin
Result := AsObject as T;
end; { TOmniValue.ToObject<T> }
That would loose the ability to pass interfaces as T, but for a given functio
nname that is not a big loss probably.
I wonder, though, how does ti compile in later Delphi. Delphi would not allow
you
function Sum<T>(x,y:T):T;
begin Result := X + Y end;
and "as" operator to me does not seem vastly different from "+" operator...
Original comment by Arioch...@gmail.com
on 22 Jul 2013 at 7:33
Fixed.
Original comment by gabr42
on 13 Oct 2013 at 9:17
Original issue reported on code.google.com by
pnv82g
on 14 Jun 2013 at 7:44