1 #pragma once
2 
3 #include <mapbox/geometry/point.hpp>
4 
5 namespace mapbox {
6 namespace geometry {
7 
8 template <typename T>
9 struct box
10 {
11     using point_type = point<T>;
12 
boxmapbox::geometry::box13     constexpr box(point_type const& min_, point_type const& max_)
14         : min(min_), max(max_)
15     {}
16 
17     point_type min;
18     point_type max;
19 };
20 
21 template <typename T>
operator ==(box<T> const & lhs,box<T> const & rhs)22 constexpr bool operator==(box<T> const& lhs, box<T> const& rhs)
23 {
24     return lhs.min == rhs.min && lhs.max == rhs.max;
25 }
26 
27 template <typename T>
operator !=(box<T> const & lhs,box<T> const & rhs)28 constexpr bool operator!=(box<T> const& lhs, box<T> const& rhs)
29 {
30     return lhs.min != rhs.min || lhs.max != rhs.max;
31 }
32 
33 } // namespace geometry
34 } // namespace mapbox
35