When the output operator is overloaded, why return a reference to an iostream object, and not just an iostream object?
class A { public: int m_a; }; ostream& operator<<(ostream left, A a) { cout << a.m_a; return left; } Source: https://ru.stackoverflow.com/questions/623832/
All Articles