
4 Sep
2007
4 Sep
'07
7:11 a.m.
Hello, Lubomir Bourdev <lbourdev@adobe.com> wrote:
The bug is not in the implementation but in the name of the function. It really should be called "convert_from_unsigned" instead of "convert_to_signed" because it takes the _destination_ type as its parameter. [...]
In your case you should write your own metafunctions. Metafunctions like is_integral_scalar, is_signed, add_sign and remove_sign should be added to Boost.TypeTraits in my opinion.
Agreed. I also noticed that, just getting the signed type is not enough. E.g. when converting with a conversion function that does not yield the nearest color, I might get an error bigger than the signed type can hold. Thank you for clearing that up. Regards Andreas Pokorny