
Hi boosters, 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? Greetings, Aki

On 9/22/05 10:36 AM, "Aschwin Gopalan" <gopalan@rohmann.de> 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?
Maybe. "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

On 9/25/05 5:43 AM, "Daryle Walker" <darylew@hotmail.com> wrote: [SNIP]
"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. [TRUNCATE]
This suggestion could be used for the bounded (numeric) type wrappers mentioned in other message threads.... -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com
participants (2)
-
Aschwin Gopalan
-
Daryle Walker