Boost logo

Boost :

Subject: Re: [boost] [xint] Design Question
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-06-16 22:41:40


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/16/2010 05:31 PM, Jeffrey Lee Hellrung, Jr. wrote:

>>> 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.

I have (explicit) conversion constructors for translating between
different types of integer. I assume that's what you meant?

> For something like operator-=, it probably makes sense to throw an
> exception, or if the policy parameters disable exceptions, the
> result should be a singular value. Of course, this could be
> *another* policy parameter, as I can see clamp-to-zero also making
> sense.

:-? I think I'm going to need some help with Boost.Parameter to
implement that. I had quite a time figuring out how to get just *one*
value per template parameter, in a way that would compile on MSVC too.
I'm not sure how to get more than one.

> I don't think you should disable use of unsigned, arbitrary-length
> integers.

That's why I asked. :-)
- --
Chad Nelson
Oak Circle Software, Inc.
*
*
*
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwZi2EACgkQp9x9jeZ9/wQkDACaA20e8TRIfMCV91vpXYi348Ss
GiQAoMg6wvIaqSCt375EnMv1embBeThg
=Njy0
-----END PGP SIGNATURE-----


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