5 ms·
Regarding drawline You can always define an implicit constructor: Point::Point(const Library::Point &p) Of course, you're now hiding a ticking time
by devbug 11y ago
Regarding
drawline
You can always define an implicit constructor:
Point::Point(const Library::Point &p)
Of course, you're now hiding a ticking time-bomb from a the next maintainer of that code.
If you absolutely want the latter case, overloading is your friend:
drawline(int x1, int y1, int x2, int y2);
drawline(Point p1, Point p2) {
drawline(p1.x, p1.y, p2.x, p2.y);
}
This, in my opinion, is the most conducive to refactoring (and modularizing code).
As an aside, you really should be doing:
drawline => drawlines
"Where's the one, there's many."