iota and BigInt

Walter Bright newshound2 at digitalmars.com
Tue May 28 10:03:59 PDT 2013


On 5/28/2013 7:26 AM, Andrei Alexandrescu wrote:
> On 5/28/13 4:32 AM, Jonathan M Davis wrote:
>> The problem is simple enough. iota doesn't currently try and work with any
>> type that has addition (like it probably should). It specifically only works
>> with integers, floating point values, and pointers.  BigInt is not an integral
>> type as far as std.traits is concerned. Only the built-in integer types are
>> integral types as far as it's concerned. What's required is a different trait
>> that tests that a type has arithmetic operations or for iota to simply test
>> that the type has + or += or whatever it needs internally. Then iota can have
>> an overload that works on any type that has the necessary operations.
>
> We should fix that; I keep on meaning to add traits like isIntegerLike etc.

With iota, shouldn't it test for the existence of ++ and --, rather than being 
integer-like?



More information about the Digitalmars-d mailing list