
On 9/9/05 1:24 PM, "Eric Niebler" <eric@boost-consulting.com> wrote: [SNIP]
Well, you haven't defined a primary template, so add_unsigned<unsigned> will not compile. IMO, your primary template should "typedef T type;". But depending on what you're trying to do, this may work, and it's a lot shorter:
template< typename Int > struct add_unsigned { typedef typename boost::uint_t< sizeof(Int) * CHAR_BIT
::least type; }; [TRUNCATE]
Your formula will include any unused junk bits a type may have. You can use "std::numeric_limits<Int>::digits" for the number of bits used. Note that the "uint_t" template itself uses that "numeric_limits" expression for its internals, so you better use it to avoid a mismatch. -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com