List Info

Thread: overload "0+" doesn't handle integer r




overload "0+" doesn't handle integer r
user name
2007-10-08 13:03:58
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.)

  
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )