diff --git a/geometry/latlon.cpp b/geometry/latlon.cpp index 0e5f74b3dd..bb9fa6fe9b 100644 --- a/geometry/latlon.cpp +++ b/geometry/latlon.cpp @@ -5,16 +5,6 @@ namespace ms { -// static -double const LatLon::kMinLat = -90.0; -double const LatLon::kMaxLat = 90.0; -double const LatLon::kMinLon = -180.0; -double const LatLon::kMaxLon = 180.0; - -// Note. LatLon(-180.0, -180.0) are invalid coordinates that are used in statistics. -// So if you want to change the value you should change the code of processing the statistics. -LatLon const LatLon::kInvalidValue = LatLon(-180.0, -180.0); - bool LatLon::operator==(ms::LatLon const & rhs) const { return m_lat == rhs.m_lat && m_lon == rhs.m_lon; } bool LatLon::operator<(ms::LatLon const & rhs) const diff --git a/geometry/latlon.hpp b/geometry/latlon.hpp index 7f286e2023..0e68b7b7a5 100644 --- a/geometry/latlon.hpp +++ b/geometry/latlon.hpp @@ -10,14 +10,14 @@ namespace ms class LatLon { public: - static double const kMinLat; - static double const kMaxLat; - static double const kMinLon; - static double const kMaxLon; - static LatLon const kInvalidValue; + static double constexpr kMinLat = -90.0; + static double constexpr kMaxLat = 90.0; + static double constexpr kMinLon = -180.0; + static double constexpr kMaxLon = 180.0; - double m_lat = kInvalidValue.m_lat; - double m_lon = kInvalidValue.m_lon; + // Default values are invalid. + double m_lat = kMinLon; + double m_lon = kMinLon; LatLon() = default; LatLon(double lat, double lon) : m_lat(lat), m_lon(lon) {}