Eeewwww! (How does the triangle draw itself?)Code:3d_object triangle(10,40,50); triangle.draw();
Eeewwww! (Why would this do anything other than print "3d_object(10,40,50)"?)Code:3d_object triangle(10,40,50); cout<<triangle;
What's wrong with your restated premise?
Don't make objects do things they weren't born to do by subverting free functions with the operators' names.Code:rendering_context my_context; // ... polygon triangle; (triangle(), 0.0f, 1.0f, 0.0f, -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f); // ... my_context << triangle;