std::ostream& operator << (std::ostream&, Foo const&);
But this operator function should be defined as a non-member function and as a friend of Foo class in order to be able to print the members of Foo properly.