We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c46039d commit 6a637b0Copy full SHA for 6a637b0
contents/jarvis_march/code/c++/jarvis_march.cpp
@@ -10,6 +10,11 @@ struct Point
10
{
11
return x == b.x && y == b.y;
12
}
13
+
14
+ bool operator!=(const Point& b) const
15
+ {
16
+ return !(*this == b);
17
+ }
18
};
19
20
std::vector<Point> jarvis_march(const std::vector<Point>& points)
@@ -38,13 +43,14 @@ std::vector<Point> jarvis_march(const std::vector<Point>& points)
38
43
39
44
);
40
45
41
- while(next_point_it != first_point_it);
46
+ while(*next_point_it != *first_point_it);
42
47
48
return hull_points;
49
50
51
int main() {
52
std::vector<Point> points = {
53
+ { 1.0, 3.0 },
54
{ 1.0, 3.0 },
55
{ 2.0, 4.0 },
56
{ 4.0, 0.0 },
0 commit comments