summaryrefslogtreecommitdiff
path: root/include/mbgl/util
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/util')
-rw-r--r--include/mbgl/util/geo.hpp14
-rw-r--r--include/mbgl/util/traits.hpp4
2 files changed, 9 insertions, 9 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);
}
diff --git a/include/mbgl/util/traits.hpp b/include/mbgl/util/traits.hpp
index 7c9499897e..9d6f947cd2 100644
--- a/include/mbgl/util/traits.hpp
+++ b/include/mbgl/util/traits.hpp
@@ -5,8 +5,8 @@
namespace mbgl {
template<typename T>
-constexpr auto underlying_type(T t) -> typename std::underlying_type<T>::type {
- return static_cast<typename std::underlying_type<T>::type>(t);
+constexpr auto underlying_type(T t) -> typename std::underlying_type_t<T> {
+ return typename std::underlying_type_t<T>(t);
}
} // namespace mbgl