From bc1f4b1fc0d96ecd544047db54d4abbffc45ee19 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 3 Feb 2016 14:14:35 -0800 Subject: [core] Comparison operators for LatLngBounds --- include/mbgl/util/geo.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/mbgl/util/geo.hpp') diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp index 99b5743877..86bc586cba 100644 --- a/include/mbgl/util/geo.hpp +++ b/include/mbgl/util/geo.hpp @@ -131,8 +131,19 @@ private: LatLngBounds(const LatLng& sw_, const LatLng& ne_) : sw(sw_), ne(ne_) {} + + friend bool operator==(const LatLngBounds&, const LatLngBounds&); + friend bool operator!=(const LatLngBounds&, const LatLngBounds&); }; +inline bool operator==(const LatLngBounds& a, const LatLngBounds& b) { + return a.sw == b.sw && a.ne == b.ne; +} + +inline bool operator!=(const LatLngBounds& a, const LatLngBounds& b) { + return !(a == b); +} + class MetersBounds { public: ProjectedMeters sw; -- cgit v1.2.1