Boost logo

Boost :

From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2007-05-09 13:52:27


On 5/9/07, Mathias Gaunard <mathias.gaunard_at_[hidden]> wrote:
> Jody Hagins wrote:
>
> > However, char, signed char, and unsigned char are different types.
> > int8_t is supposed to be typedef'd as signed char, which is a different
> > type than char. I do not see any reason lexical_cast<int8_t>() or
> > lexical_cast<signed char>() should be treated the same way as
> > lexical_cast<char> since the internal C++ type mechanisms treat "char"
> > "signed char" and "unsigned char" as completely different types...
>
> Quite an interesting idea.
> So 'char' would be a character, but 'signed char' and 'unsigned char'
> would be integers.
>
> This behaviour might break some code, but I don't think 'signed char' or
> 'unsigned char' are much used to store characters.

unsigned char are very used for type punning. IIRC, the only standard
way to do that. So, unsigned char is used at least to hold "bytes",
not only numbers.

-- 
Felipe Magno de Almeida

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