summaryrefslogtreecommitdiff
path: root/include/mbgl/util/geo.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-03 14:14:35 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-03 18:09:06 -0800
commitbc1f4b1fc0d96ecd544047db54d4abbffc45ee19 (patch)
tree8cf649a362c7c8b42cf0955ab535cc3e82413b40 /include/mbgl/util/geo.hpp
parent87bac32a3320f5ec04e90781dbaa3fcb83aa47c2 (diff)
downloadqtlocation-mapboxgl-bc1f4b1fc0d96ecd544047db54d4abbffc45ee19.tar.gz
[core] Comparison operators for LatLngBounds
Diffstat (limited to 'include/mbgl/util/geo.hpp')
-rw-r--r--include/mbgl/util/geo.hpp11
1 files changed, 11 insertions, 0 deletions
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;