|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2001-03-11 15:41:39
The class templates boost::int_t and boost::uint_t, in <boost/integer.hpp>
let an user find the smallest built-in type that has at least the given
amount of bits, if possible. I was wondering if we could make similar class
templates, but only work if the given number of bits is _exactly_ a count of
a built-in type. For example, on most common systems, we would want
instances of 8 (unsigned char), 16 (unsigned short), and 32 (unsigned long)
bits to work, but would want counts like 24 or 13 bits to fail.
I'm asking this because of the apparent debacle over masking unneeded higher
bits in my CRC classes. I don't have to worry about masking if the bit size
matches a built-in type exactly. (This is only for the fast CRC class, I
have an alternative for the slow CRC class.)
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk