![]() ![]() ![]() | Class LineSegment WITHOUT copy constructor and and WITHOUT assignment operator. | Lecture 3 - slide 15 : 36 Program 1 |
#include <iostream> class Point { private: double x, y; public: Point(double, double); Point(); double getx () const; double gety () const; void move(double, double); double distance_to(Point) const; }; class LineSegment { private: Point *points; size_t number_of_points; public: LineSegment(size_t s = 10); // Serves the role as default constructor. ~LineSegment(); // ... }; std::ostream& operator<<(std::ostream&, const Point&);