当你为一个类重载<<运算符(假装它被定义为SomeClass中的一个朋友)时,为什么你们都引用了ostream并返回那个ostream?
ostream& operator<<(ostream& s, const SomeClass& c) {
    //whatever
    return s;
}
当ostream已经可以通过引用直接修改时,它可以带来什么好处呢?这对我来说似乎是多余的 - 虽然我确定它不是:)
它允许将输出"链接"在一起.如:
std::cout << someObj << someValue;
这相当于:
operator<<(operator<<(std::cout, someObj), someValue);