Boost logo

Boost :

Subject: Re: [boost] [xint] Design Question
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-06-16 17:47:33


----- Original Message -----
From: "Jeffrey Lee Hellrung, Jr." <jhellrung_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, June 16, 2010 11:31 PM
Subject: Re: [boost] [xint] Design Question

>
> On 6/16/2010 2:30 PM, Chad Nelson wrote:
>> On 06/16/2010 02:31 PM, vicente.botet wrote:
>>
>>>> The problem is: what should the library do if the user asks for an
>>>> unsigned *non*-fixed-length integer? [...]
>>>
>>> What about making the difference between two unsigned integers a
>>> signed integer?
>>
>> That sounds like a useful behavior, but if the developer using the
>> library says it should be an unsigned number, I don't think the library
>> should override that.
>
> I think Vicente probably had operator- in mind. Then you'd need signed
> <-> unsigned conversions, but I'd think that would be expected.

Yes, I expected signed <-> unsigned conversions, and an exception if the signed is < 0. The user can always test if the signed is <0 and do whatever s/he thinks is better for its application if s/he wants a unsigned value.
 
 
> I don't think you should disable use of unsigned, arbitrary-length integers.
+1

Best,
Vicente


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