My operator << cannot do nested actions

I explain it:
I have :
myclass<<"hello"<<"again";
or
myclass<<"hello"<<int_value;

My compiler says me :
error: void value not ignored as it ought to be

And I have to separate the actions:
myclass <<"hello";
myclass <<"again";
myclass<<"hello";
myclass<<int_value;

Any help ? Thanks
Last edited on
Return a reference to your class in operator <<
OK ! I solved it.
For everybody who needs it :

MYCLASS& MYCLASS::operator << (std::string data) {
......
return *this;
}
Topic archived. No new replies allowed.