
13 Oct
2012
13 Oct
'12
11:57 p.m.
On 13/10/12 16:35, Jochen Wilhelmy wrote:
another question is why does lexical_cast treat int8_t and uint8_t like char? technically I see no reason for this as c++ has three types: char, signed char and unsigned char. in my code I use only char for characters and signed/unsigned char as numbers. I know that the standard stream operator << treats signed/unsigned char as char but I know no explanation for this (I consider it a bug ;-)
Whatever we think of the standard streams' decision (and indeed I agree it's dubious), lexical_cast behaves in this way because it is defined in terms of the standard streams. Personally I think that is the right choice. Consistency is more important than tweaking each individual case. John