This minimal code example(this problem disturbs the ICQ-Client ickle, but ickles code is much bigger, therefore I made this short example) worked well with gcc 2.95 and 2.96. After executing the program the command line showed: a a With 3.11 (latest from cooker=gcc-3.1.1-0.7mdk) I got: a 97 So the char is casted is streamed into the stream as a short.
greetings Christian Bornträger File attached and pasted -------------------------------------------------- #include <iostream> #include <sstream> using namespace std; class testclass: public ostringstream { public: testclass& operator<<(char c); }; testclass& testclass::operator<<(char c) { ostringstream::operator<<(c); return (*this); } int main () { testclass t; ostringstream o; char a='a'; o<<a; t<<a; cerr<<o.str()<<endl; cerr<<t.str()<<endl; }
#include <iostream> #include <sstream> using namespace std; class testclass: public ostringstream { public: testclass& operator<<(char c); }; testclass& testclass::operator<<(char c) { ostringstream::operator<<(c); return (*this); } int main () { testclass t; ostringstream o; char a='a'; o<<a; t<<a; cerr<<o.str()<<endl; cerr<<t.str()<<endl; }