An example of implementation:
{$MODESWITCH TYPEHELPERS}{$INLINE ON}
uses
SysUtils;
type
TDoubleHelper = type helper(SysUtils.TDoubleHelper) for Double
public
function Round(): Int64; inline;
end;
function TDoubleHelper.Round(): Int64;
begin
Result := System.Round(Self);
end;
I suppose I could overload the class and add it but that works only per unit […]
Exactly, that's how the helpers work.
unless I use a INC file.
Don't do this. You still need to add one line of code in each unit, so it's better to have one helper instead of many the same (for the compiler it matters).