Boost logo

Boost :

Subject: Re: [boost] New Boost.XInt Library, request preliminary review
From: Christopher Jefferson (chris_at_[hidden])
Date: 2010-03-30 17:49:26


On 30 Mar 2010, at 22:47, Scott McMurray wrote:

> On 30 March 2010 17:40, Chad Nelson <chad.thecomfychair_at_[hidden]> wrote:
>>
>> Well, it's not called an "infinite range integer," after all. :-) Just
>> an unlimited one, because the library does not place any limits on it.
>> Only available memory, and the time needed to operate on something that
>> large, do.
>>
>
> The library *does* impose a limit: It has to allocate space, so
> there's necessarily the limit implied by the size of the type passed
> to the allocator to request the space.
>
> Take, for instance:
>
> pow(xint(-1u), xint(-1u))
>
> That should probably throw an overflow error from checking ahead of
> time that the amount of memory requested is infeasible in the same way
> as std::vector<int>(-1) will throw a std::length_error.

By the same argument, should we changed the hashed containers to "dynamically unspecified size hashed containers"?

Chris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk