Copy of geometry.hpp-0.9.0 (e3acceb)

This commit is contained in:
Eric Fischer
2016-12-07 14:11:53 -08:00
parent 89bfd27a8b
commit c0d5171f1d
13 changed files with 528 additions and 0 deletions
+34
View File
@@ -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