const function body can't change members of class.The operator << will change the ostream object, if the ostream object is a member.
this is example in C++ primer(5th edition):
class PrintString{
public:
PrintString(ostream &o = cout, char c = ' '):
os(o), sep(c) {}
void operator()(const string &s) const { os << s << sep; }
private:
ostream &os;
char sep;
};
why can write like "const {os << s << sep;}"? Does the operator << change the os?