Hairy Pixels via fpc-devel <fpc-devel@lists.freepascal.org> schrieb am Sa., 14. Juni 2025, 18:20:
> On Jun 14, 2025 at 10:50:46 PM, Martin Frb via fpc-devel < > fpc-devel@lists.freepascal.org> wrote: > >> I may... Need to find some time. >> >> Also, what do you think about overloading AssertEquals (and the like) >> taking >> AssertEqual( >> const AnFormatString: string; >> const AFormatData: array of const; >> AnExpect, >> AnActual: TFoo >> ) >> ? >> > > Curious, if the function was actually inline wouldn’t the condition be > tripped and exit before calling the format call which was passed in? FPC > often fails to inline for various reason so if it can’t I agree your > solution makes sense. > If the compiler would indeed inline in this case, then yes, the Format call would be skipped. However open arrays are currently not supported for inlining. But even without inlining this is simply more convenient for a user (I often have such formatting related overloads in my own code as well). Regards, Sven >
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel