diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-06-17 12:18:39 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-06-18 20:23:00 +0300 |
commit | 41497e9c4174d310f3a62548f3cfeb9da2852849 (patch) | |
tree | ae3e0fc54f10cba24f61bf22c440d45c87c9441a /include/mbgl/util/geo.hpp | |
parent | 0006c9c27542da2f262e7bc105999f3072e4b6f2 (diff) | |
download | qtlocation-mapboxgl-41497e9c4174d310f3a62548f3cfeb9da2852849.tar.gz |
[core] Cleaned up enum classes
- Replaced static_cast with C++ casts.
- Replaced inline with constexpr.
Diffstat (limited to 'include/mbgl/util/geo.hpp')
-rw-r--r-- | include/mbgl/util/geo.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp index 4af8906465..a68058048d 100644 --- a/include/mbgl/util/geo.hpp +++ b/include/mbgl/util/geo.hpp @@ -57,11 +57,11 @@ public: LatLng(const UnwrappedTileID& id); }; -inline bool operator==(const LatLng& a, const LatLng& b) { +constexpr bool operator==(const LatLng& a, const LatLng& b) { return a.latitude == b.latitude && a.longitude == b.longitude; } -inline bool operator!=(const LatLng& a, const LatLng& b) { +constexpr bool operator!=(const LatLng& a, const LatLng& b) { return !(a == b); } @@ -78,7 +78,7 @@ public: } }; -inline bool operator==(const ProjectedMeters& a, const ProjectedMeters& b) { +constexpr bool operator==(const ProjectedMeters& a, const ProjectedMeters& b) { return a.northing == b.northing && a.easting == b.easting; } @@ -164,15 +164,15 @@ private: LatLngBounds(LatLng sw_, LatLng ne_) : sw(std::move(sw_)), ne(std::move(ne_)) {} - friend bool operator==(const LatLngBounds&, const LatLngBounds&); - friend bool operator!=(const LatLngBounds&, const LatLngBounds&); + friend constexpr bool operator==(const LatLngBounds&, const LatLngBounds&); + friend constexpr bool operator!=(const LatLngBounds&, const LatLngBounds&); }; -inline bool operator==(const LatLngBounds& a, const LatLngBounds& b) { +constexpr 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) { +constexpr bool operator!=(const LatLngBounds& a, const LatLngBounds& b) { return !(a == b); } |