Boost logo

Boost :

From: outlaw (outlaw_at_[hidden])
Date: 2000-01-06 10:56:40

> Therefore, I have made 'signed char' a signed integral type, 'unsigned
> an unsigned integral type, and 'char' an integral type that is neither
> signed nor unsigned. I claim that this makes sense, even on systems where
> 'char' is (for example) signed, because 'char' and 'signed char' are still
> distinct types (3.9.1p10).

I've always interpreted that section of the standard as such, whereby char,
signed char, and unsigned char are three distinct types. Would it be
possible to determine if a compiler interprets the standard likewise using
an attempted implicit type conversion? On my compiler all the following
assignment attempts fail with "cannot convert from 'x *' to 'y *' Types
pointed to are unrelated; conversion requires reinterpret_cast, C-style cast
or function-style cast".

char* pa;
signed char* pb;
unsigned char* pc;

int main(){
 pa = pb;
 pa = pc;

 pb = pa;
 pb = pc;

 pc = pa;
 pc = pb;

Mario Contestabile

Boost list run by bdawes at, gregod at, cpdaniel at, john at