1 #pragma once
2 
3 namespace mapbox {
4 namespace geometry {
5 
6 template <typename T>
7 struct point
8 {
9     using coordinate_type = T;
10 
pointmapbox::geometry::point11     constexpr point()
12         : x(), y()
13     {
14     }
pointmapbox::geometry::point15     constexpr point(T x_, T y_)
16         : x(x_), y(y_)
17     {
18     }
19 
20     T x;
21     T y;
22 };
23 
24 #pragma GCC diagnostic push
25 #pragma GCC diagnostic ignored "-Wfloat-equal"
26 
27 template <typename T>
operator ==(point<T> const & lhs,point<T> const & rhs)28 constexpr bool operator==(point<T> const& lhs, point<T> const& rhs)
29 {
30     return lhs.x == rhs.x && lhs.y == rhs.y;
31 }
32 
33 #pragma GCC diagnostic pop
34 
35 template <typename T>
operator !=(point<T> const & lhs,point<T> const & rhs)36 constexpr bool operator!=(point<T> const& lhs, point<T> const& rhs)
37 {
38     return !(lhs == rhs);
39 }
40 
41 } // namespace geometry
42 } // namespace mapbox
43