Boost logo

Boost :

Subject: Re: [boost] numeric_cast
From: Ilya Sokolov (ilyasokol_at_[hidden])
Date: 2011-07-15 01:53:05


On Thu, 14 Jul 2011 22:05:12 +0600, Brandon Kohn <blkohn_at_[hidden]>
wrote:

> [snip]
> I found
> something that was a bit of a surprise though on msvc10. The 'char' type
> is not the same as int8_t (signed char) or uint8_t(unsigned char). I
> would have expected the former. I explicitly added char specialization
> to the args sent to the code generation macros, but I expect this won't
> be correct for all compilers.

MSVC is right. According to 3.9.1/1 of 14882:2003,
"... Plain char, signed char, and unsigned char are three distinct types.
...
and
"... In any particular implementation, a plain char object can take on
either the same values as a
signed char or an unsigned char; which one is implementation-defined. ..."


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk