Skip to content

Commit

Permalink
Move Point ctor into .cc file to hide shadowing from users
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Aug 21, 2021
1 parent 7f0487a commit 136fa7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions poly2tri/common/shapes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@

namespace p2t {

Point::Point(double x, double y) : x(x), y(y)
{
}

std::ostream& operator<<(std::ostream& out, const Point& point) {
return out << point.x << "," << point.y;
}
Expand Down
2 changes: 1 addition & 1 deletion poly2tri/common/shapes.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct Point {
std::vector<Edge*> edge_list;

/// Construct using coordinates.
Point(double x, double y) : x(x), y(y) {}
Point(double x, double y);

/// Set this point to all zeros.
void set_zero()
Expand Down

0 comments on commit 136fa7a

Please sign in to comment.