Boost logo

Boost :

Subject: Re: [boost] [xint] Design Question
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-06-16 23:01:13


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

On 06/16/2010 09:32 PM, Scott McMurray wrote:

>> [...] Can anyone think of a potential reason for options C or D? Or
>> a reason to prefer option B? Or maybe come up with a different
>> idea entirely?
>
> How about this combo of B, C, and D:
> - if !i, --i and i-- both throw exceptions.
> - a - b doesn't compile for non-fixed length
> - provide a separate absdiff(a, b) function

Do you know of any way, short of making two nearly-identical copies of
the integer_t class template, to provide different functions? I tried
using multiple templated base classes, but the compiler seemed unable to
find the inherited functions at all that way, for reasons I don't
understand.

(That's why the current setup isn't exactly how policy-based design is
described, and why all different integer_t types have exactly the same
functions, even when they don't make sense for that particular type of
integer.)

If you want examples of the problem, I'll have to work some up again. I
was more interested in getting it to work, so I didn't save any.
- --
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/

iEYEARECAAYFAkwZj/kACgkQp9x9jeZ9/wTuIQCg+VEGwb+Yautuw/WdJvzY7xnY
s/4AoPaVMZaMpShUazk7O8+U9pADrA+q
=IP2i
-----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