class mystream : public std::stringstream
{
public:
void write_something()
{
this << "something";
}
};
This results in the following two compile errors on VC++10:
error C2297: '<<' : illegal, right operand has type 'const char [10]'
error C2296: '<<' : illegal, left operand has type 'mystream *const '
Judging from the second one, this is because what this
points at can't be changed, but the << operator does (or at least is declared as if it does). Correct?
Is there some other way I can still use the <<
and >>
operators on this
?