Zefram wrote:
> It works OK for plain printf "%d", but not
for addition.
> Also doesn't work for subtraction, negation,
> multiplication, division, remainder. Does work for
bit
> shift and bitwise OR. Perhaps some code factoring is
> called for.
Jerry D. Hedden wrote:
> The attached patch adds tests for these to
lib/overload.t.
> The tests are skipped if not using 64-bit ints.
> The following tests (which fail for me) are set as
TODO:
> 0+ (addition)
> subtraction
> multiplication
> division
> modulo (%)
> exponentiation (**)
> abs()
Programming by example, the attached patch fixes the above
problem for abs() overloading. I added more tests as well.
(This supercedes my previous patch with lib/overload.t
tests.)
|