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 coordinate_type = T;
12     using point_type = point<coordinate_type>;
13 
boxmapbox::geometry::box14     constexpr box(point_type const& min_, point_type const& max_)
15         : min(min_), max(max_)
16     {
17     }
18 
19     point_type min;
20     point_type max;
21 };
22 
23 template <typename T>
operator ==(box<T> const & lhs,box<T> const & rhs)24 constexpr bool operator==(box<T> const& lhs, box<T> const& rhs)
25 {
26     return lhs.min == rhs.min && lhs.max == rhs.max;
27 }
28 
29 template <typename T>
operator !=(box<T> const & lhs,box<T> const & rhs)30 constexpr bool operator!=(box<T> const& lhs, box<T> const& rhs)
31 {
32     return lhs.min != rhs.min || lhs.max != rhs.max;
33 }
34 
35 } // namespace geometry
36 } // namespace mapbox
37