1234567891011121314
std::ostream& operator<<( std::ostream& out, const Point& p ) { out << "Point (" << p.get_x() << ", " << p.get_y() << ")\n"; return out; } void Point::printShapeInfo() { Point::ostream& operator<<( out, p); }
123456789
void Point::printShapeInfo() { std::cout << *this; } //or void Point::printShapeInfo(std::osream& out) { out << *this; }