> Hello, > > Let's say there is a function > > function ICmp(A,B: PBigInt): SInt32; > > and a TBigIntList class having the following method that can > sort the list according to Cmp > > procedure TBigIntList.Sort(Cmp: TBigIntCompareFunc); > > with, of course, > > type TBigIntCompareFunc = function(A,B: PBigInt): SInt32; > > > Now, if ICmp is not overloaded, there is no problem, the call > > L.Sort(@ICmp); > > works. But, of course, it doesn't work if ICmp is overloaded. > In fact, we cannot have both overloaded functions _and_ the > the possibility to use them as variables. Yes, there are > ways to fix the problem (no overload or embedding the > overloaded functions in local functions) but none is really > satisfying. > > Would it be possible to get something like > > L.Sort(@ICmp(PBigInt,PBigInt)); > > in case ICmp is overloaded? If we could add the parameter > types, there would be no more ambiguity, the compiler would
There is ambiguity with a normal call to the function. The compiler sees the ( and thinks it is parsing a call to Icmp(). _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel