Mega Search
23.2 Million


Sign Up

Make a donation  
Min / Max function with comiler magic?  
News Group: embarcadero.public.delphi.language.delphi.general

I wrote some integer / float helper methods for global functions in Math.pas

e.g.
  SameValue()   

  TIntegerHelper = record helper for Integer
  public
    function IsSame(AOther: Integer): Boolean;
  end;


In order to cleanup my application, I remove all references to "Math" unit from all files. The only
functions that remain as global functions are Min / Max since I didn't find a reasonable name to
bind them in a record helper.

So I copied this code from Math.pas to my library unit.

Unfortunately I get a compiler error now (Ambiguous overloaded call to 'Min' on the following line:

Min(n + 64, Count);

n and Count are both of type Integer.

Can somebody explain me, what's the difference and if I can solve this problem?

cu Christian

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 22-Jan-2015, at 5:19 AM EST
From: Christian Kaufmann