From 0ed2885ececf079f16b42fec60a4dc86285b5101 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Wed, 7 Nov 2018 11:06:42 +0900 Subject: add tbtnavi source --- include/mapbox/geometry/point.hpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/mapbox/geometry/point.hpp (limited to 'include/mapbox/geometry/point.hpp') diff --git a/include/mapbox/geometry/point.hpp b/include/mapbox/geometry/point.hpp new file mode 100644 index 0000000..0cba499 --- /dev/null +++ b/include/mapbox/geometry/point.hpp @@ -0,0 +1,35 @@ +#pragma once + +namespace mapbox { +namespace geometry { + +template +struct point +{ + using coordinate_type = T; + + constexpr point() + : x(), y() + {} + constexpr point(T x_, T y_) + : x(x_), y(y_) + {} + + T x; + T y; +}; + +template +constexpr bool operator==(point const& lhs, point const& rhs) +{ + return lhs.x == rhs.x && lhs.y == rhs.y; +} + +template +constexpr bool operator!=(point const& lhs, point const& rhs) +{ + return !(lhs == rhs); +} + +} // namespace geometry +} // namespace mapbox -- cgit