Subject: Re: [boost] [xint] Sixth release, preliminary review again please
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-06-29 11:26:57
-----BEGIN PGP SIGNED MESSAGE-----
On 10-06-29 07:41 AM, DE wrote:
>>> one more thing: i liked it better when arbitrary sized integer and
>>> fixed integer were distinct classes
>> What did you like about it, that the current design doesn't have? Maybe
>> I can make the current one work that way too.
> from a user point of view i find it more convenient when distinct
> entities are responsible for distinct well defined tasks
> in this case i don't like the all-in-one solution because fusion of
> these distinct things involves mixing of completely unrelated details
> e.g. lets say unbounded integer by definition has no signedness (it is
> always signed) but on the other hand finite representation (like
> binary 2's complement or other) has well defined concepts of
> signed/unsigned integers
I prefer distinct classes for logically distinct purposes as well, but
several people recommended combining them. And I have to admit, the code
will be a lot easier to maintain that way.
> i like that error behavor is now a parameter of a template because in
> fact it just controls such a small detail that we actually don't
> expect to show itself at all
> contrary, unbounded and bounded integers cover slightly different scopes
You might be surprised at how similar they are though, and how few code
changes are really needed between them.
> all this is just my personal complaint so don't take it too close
I'll try not to. :-)
One thing I considered was (re)adding a fixed_integer class, which took
the same parameters as the integer_t class but made the fixedlength one
mandatory. I abandoned the idea because, although logically tempting,
there was no practical benefit to it, and I'd have to duplicate a lot of
code to do it.
In any case, since you'll almost certainly be using typedefs to identify
the different types of integers used, your code should be just as
readable with only integer_t as it would with fixed_integer.
Oak Circle Software, Inc.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----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