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/box.hpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 include/mapbox/geometry/box.hpp (limited to 'include/mapbox/geometry/box.hpp') diff --git a/include/mapbox/geometry/box.hpp b/include/mapbox/geometry/box.hpp new file mode 100644 index 0000000..bf81b70 --- /dev/null +++ b/include/mapbox/geometry/box.hpp @@ -0,0 +1,34 @@ +#pragma once + +#include + +namespace mapbox { +namespace geometry { + +template +struct box +{ + using point_type = point; + + constexpr box(point_type const& min_, point_type const& max_) + : min(min_), max(max_) + {} + + point_type min; + point_type max; +}; + +template +constexpr bool operator==(box const& lhs, box const& rhs) +{ + return lhs.min == rhs.min && lhs.max == rhs.max; +} + +template +constexpr bool operator!=(box const& lhs, box const& rhs) +{ + return lhs.min != rhs.min || lhs.max != rhs.max; +} + +} // namespace geometry +} // namespace mapbox -- cgit 1.2.3-korg