summaryrefslogtreecommitdiffstats
path: root/include/mapbox/geometry/box.hpp
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-02 14:13:07 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-02 14:13:07 +0900
commit30d24cbc67ef416672a3386b10be8fe6711c65d7 (patch)
treeecc8813e6742661e1521d6399d04cc4abc54587f /include/mapbox/geometry/box.hpp
parentae47635e56c4af4d816a76e5186e945768543679 (diff)
use mapbox as navigation
Diffstat (limited to 'include/mapbox/geometry/box.hpp')
-rw-r--r--include/mapbox/geometry/box.hpp34
1 files changed, 34 insertions, 0 deletions
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 <mapbox/geometry/point.hpp>
+
+namespace mapbox {
+namespace geometry {
+
+template <typename T>
+struct box
+{
+ using point_type = point<T>;
+
+ constexpr box(point_type const& min_, point_type const& max_)
+ : min(min_), max(max_)
+ {}
+
+ point_type min;
+ point_type max;
+};
+
+template <typename T>
+constexpr bool operator==(box<T> const& lhs, box<T> const& rhs)
+{
+ return lhs.min == rhs.min && lhs.max == rhs.max;
+}
+
+template <typename T>
+constexpr bool operator!=(box<T> const& lhs, box<T> const& rhs)
+{
+ return lhs.min != rhs.min || lhs.max != rhs.max;
+}
+
+} // namespace geometry
+} // namespace mapbox