Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2005-09-25 04:43:00

On 9/22/05 10:36 AM, "Aschwin Gopalan" <gopalan_at_[hidden]> wrote:

> I am trying to do a small template based fixed-point arithmetic library
> and I am using integer_mask.hpp to extract some bit-masks I need.
> Everything works as expected as long as my fixed-point numbers are not
> larger than 32bit. I am on Intel hardware using gcc and there is long
> long, wich is 64bit. I would like to be able to use it together with my
> fixed point template, but integer_mask.hpp works only up to long. Is
> there a compelling reason for this?


"integer_mask.hpp" doesn't use any extended integer types because
"integer.hpp" didn't either.

"integer.hpp" doesn't use any extended integer types because:
1. Their existence in compilers back then (2001) were more rare.
2. There were concerns back then that the extended types could not
    be used in value-based template parameters. That's important since
    Boost.CRC does that type of usage. I don't know how accurate that
    concern was then or is now.

Possible solutions:
A. Determine the largest integer type that can be used as a template
    parameter, and make new typedef-s if the result ever differs from
    (u)intmax_t on some platform. (Or we can always define the typedef
    to make it always available.) Make sure Boost.CRC uses the
    appropriate typedef.
B. Change Boost.CRC to always use "unsigned long" for its value-based
    template parameters (or the typedef given in [A]).

Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

Boost list run by bdawes at, gregod at, cpdaniel at, john at