From bc1f4b1fc0d96ecd544047db54d4abbffc45ee19 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 3 Feb 2016 14:14:35 -0800 Subject: [PATCH] [core] Comparison operators for LatLngBounds --- include/mbgl/util/geo.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp index 99b574387..86bc586cb 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;