iota and BigInt

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue May 28 07:26:59 PDT 2013


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.

Andrei


More information about the Digitalmars-d mailing list